cryptpad icon indicating copy to clipboard operation
cryptpad copied to clipboard

Please Add AsciiDoc Syntax Highlighting Support

Open gitjeff2 opened this issue 7 years ago • 5 comments

Please add AsciiDoc support to the syntax highlighter. As a handy reference, here is an example of Vim syntax highlighting file with the required regular expressions to make this happen.

gitjeff2 avatar Jul 21 '18 21:07 gitjeff2

+1

matbgn avatar Apr 02 '20 10:04 matbgn

I'll prioritize this at the same level as this issue requesting hard-wrapping in CodeMirror.

ansuz avatar Apr 03 '20 17:04 ansuz

Thx for your so quick answer. I could also imagine a sort of donation/sponsorship. Contact me in private if you have any interest/time to put it in your pipeline this way.

matbgn avatar Apr 03 '20 18:04 matbgn

@ansuz: Also, maybe this source code (MIT licensing) for live editing could dramatically simplify the integration:

http://espadrine.github.io/AsciiDocBox/ https://github.com/espadrine/AsciiDocBox/

or maybe:

https://github.com/jichu4n/asciidoclive

matbgn avatar Apr 30 '20 09:04 matbgn

To support this at the same level as Markdown, with the live preview, I think you'd need https://github.com/asciidoctor/asciidoctor.js
It's what the two projects linked in the previous comment use for rendering. AsciiDocBox also uses CodeMirror, as CryptPad does, so it's a good comparison.

Asciidoc does have https://github.com/asciidoctor/codemirror-asciidoc which I imagine would be easy enough to plug in to your codemirror instance, but just by skimming that file, I am assuming it only does a little bit of syntax highlighting, it doesn't render it.

asciidoctor.js is 738 kB minified. That looks like it's more than codemirror itself. That means you'd want to be careful about not loading it when you don't need it, but it looks like you've already got scripts loading in a modular way.

keturn avatar Mar 26 '21 23:03 keturn

This has been released in v5.1 thanks to @mcesson's work. Closing this issue!

ghost avatar Sep 22 '22 13:09 ghost