Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
"Hashtags" in code blocks get parsed as hashtags #6
As reported here: https://mst3k.interlinked.me/@cadey/100673777784986480
How about this idea?
instead of using regexp for replacing hashtags, using a parser that does different passes. Like this https://github.com/russross/blackfriday/blob/master/markdown.go#L405
It would be something like this:
assign last_codeblock_end = 0
start = 0
I don't think its possible to parse it using regexp, at least not with vanilla regexp, I'm not sure how different Go's regexp is from the regular expression used in theory of computation.
Just for reference, this is the code that needs changing:
Hope this helps.
How can we move forward here? This is probably less trivial than it looks. Some things which stood out to me:
@MCSH Agreed that regex isn't the right solution, and some kind of better parser is needed. Thanks for the suggestion!
This improves rendering in a number of situations: - it keeps anchor tags working - it gives the user some control for not linking, for example in code blocks. Con: hashTags at the beginning of a line without a space won't get linked. Workaround related to issues writeas#42 and writeas#6 and writeas#33