threepointone/markdown-in-js

Special Characters and code

Closed this issue · 7 comments

I've been working on porting my gitbook markdown into react components rendered through markdown-in-js. However I run into several issues with the characters below. Those characters are often in prismjs codeblocks or inline blocks between text . I've gotten errors for these in the console but the errors point to basic text that aren't the cause of the error.

` > = < () # -

Are code block contents not escaped?

would it be possible to use this to denote codeblocks or inline-blocks to avoid having to escape characters:

@@@js
 //some code in here
@@@

some text @@inline code block@@ some text

Not sure if it's a good idea but I never really use that symbol twice anywhere.

I love the idea! Open to PRs if you're up to it, or I'll get to it sometime next week.

Not sure If I can make the PR, starting school on monday.

Don't sweat it, I'll get to it soon.

And best of luck at school! :)

Running into this too. Are code blocks supposed to be escaped? Little unclear after reading the commonmark spec, but it seems like they don't have to be. Could we just remove the escape from this? https://github.com/threepointone/markdown-in-js/blob/master/src/jsx.js#L144

EDIT: Mighta been a weird webpack thing actually. Breaking the code into a new file seems to have fixed this 🤔. Sorry!

EDIT 2: Maaaaybe not. Having a hard time reproducing this, but it still comes up. If I change the above function to use this.lit instead of this.out it seems to always work, though.

@threepointone any updates on this?

Taking a break from OSS, won't get to this for a while. I'll accept a PR though.