Define usage of ambiguous symbols (eg. #, -)
From the Readme:
An example of conflict is "#" symbol. It is used in Haml for id attribute, and in Markdown as headers.
A quick solution might be to prohibit ids in Haml part of Hamdown. A smarter solution would be to treat #person_233 Max as Haml, and # Max as Markdown
My suggestion below.
Number sign (#)
If a line starts with #, it is treated as a Markdown header. Hence #person_233.person would be treated as an h1.
If one wants to use the Haml id shorthand, explicitly name the %div tag, as in %div#person_233.
Hyphen-minus (-)
If a line starts with -, it is treated as embedded code (Haml), not as a list (Markdown).
If you need to make a list, use the asterisk (*) character.
Thanks! I was thinking about it and came to the same conclusions!
Re: the heading sign, I'm not sure how Markdown parsers in Ruby implements this, but both CommonMark and GitHub Flavored Markdown needs a space between the hash signs and the content of the heading.
So the original solution is achieved without compromising either language: #person_233 Max would be picked up by Haml but rejected by Markdown, and # heading 1 would be picked up by Markdown but rejected by Haml.
I feel like we'll need to attack paragraph semantics next