2 ms·
> The $RET$ hack smells weird. Can you join the lines before flushing it down the markdown renderer? Unfortunately this didn't work since it would also join li
by Borkdude 5y ago
> The $RET$ hack smells weird. Can you join the lines before flushing it down the markdown renderer?
Unfortunately this didn't work since it would also join lines in code snippets that contained []'s.
This is a basic hack that prevented me from writing a more sophisticated markdown parser.
- cxr 5y agoThe problem with things like the $RET$ hack is that now you have a forbidden magic character sequence. Although this isn't the worst thing in the world, it doesn't look like you're doing basic validation on your input to make sure that that sequence doesn't already appear organically, which is the consequence of doing things this way. Considering you now have at least one input file where this sequence does appear organically (i.e. this blog post), I'm also curious how your setup is handling this correctly instead of mangling the content. What am I missing?
- Borkdude 5y agoSince this is my personal script, I'll take the trade-off of not being able to use $RET$. If I would have written a framework or library, I would have solved it more at the root level, but that wasn't a cost I was ready to pay at this stage. The real sequence is $$RET$$ so what you see in the blog post is a variant of this, just to explain the idea.
- Borkdude 5y agoI added a clarification of this in the blog post.