Closed mxstbr closed 6 years ago
It would be amazing!
I think remarkable, the markdown parser we use, already supports this to some degree, so this may be quite simple to implement. Adding help wanted tag if someone wants to try, otherwise I'll take a look when I have some free time 😄
Yeah so the language is included as params
already by remarkable. So may just need to add data: item.params
to the DefaultBlockTypes
fence
Releasing a change in 0.7.0
to include "language" as an optional data attribute to code blocks!
Awesome, thanks for the quick response @Rosey—sorry I missed your message to test this 😅
hey no worries it's not your job :) Just was a favour. I did take a quick look at to be honest I think it may not work well with that plugin? No error messages but I didn't see any syntax highlighting either. But the data does seem to be correct so I thought perhaps it was an issue with the plugin rather than with the converter. Or I just was rushing my testing and did something wrong 🙃
GitHub lets you write fenced codeblocks with syntax highlighting:
The syntax for defining the language to highlight as is
It'd be great if
markdown-draft-js
recognized that language declaration and added either alanguage
or asyntax
field to thedata
of the code block so that e.g. thedraft-js-prism-plugin
can pick it up.