logoalt Hacker News

pratikdeoghare • yesterday at 9:34 PM • 1 reply • view on HN

I wanted to keep the famaliar things. We write code blocks with backticks in markdown and slack and everywhere so I used those. In fact I used $ signs earliar then switched to backticks.

> 'this is a bag named code with a blob, therefore it is code."

This would make #code{} a special bag. Right now no bag is special. Also it would be hard to find the closing } if somebody wrote unbalanced paren code in the bag like #code{ func main() { }.


Replies

CrimsonCape • yesterday at 10:53 PM

Fair point on the unbalanced braces. However,

You could assume that { and } as a structural delimiter only applies to node types that can nest. Since blobs do not nest, then a tag followed by a backtick (or multiple backticks) could be a valid delimiter in lieu of braces. In this case, tags would extend to blobs.

In my opinion, pairing minimal node types with differing delimiters helps legibility and is not overly mentally taxing to learn when node types are few.