Pandoc: Pandoc highlighting does not support JavaScript JSX

Created on 13 Feb 2017  路  8Comments  路  Source: jgm/pandoc

React is an extremly popular JavaScript library. It embeds a scripting language called JSX in normal JS code. Even though pandoc supports JavaScript, it does not support JSX. It is also not listed under the pandoc --list-highlight-languages. Just wanted to tell how a result looks like.
2017-02-13 19 55 46

Most helpful comment

All 8 comments

We'd need a jsx.xml syntax definition for the KDE syntax
highlighting framework, and then we can add it. I don't
see one in their repository (over 220 syntaxes).

If you feel like making one, go ahead, but do submit it
upstream to KDE.

Soon pandoc will have the ability to load xml syntax
definitions dynamically, which will give you a way to add
this without recompiling the highlighting library.

PS. See jgm/skylighting, which is the library we use for
highlighting, for more details.

Ok, thanks for the fast response. I have a look at the xml library. Close this for the time being.

hi @karland did you make any progress on this one? :)

Hi @jakoblind, no unfortunately not.

I figured it out. In latest version of pandoc it accepts a parameter --syntax-definition so you can pass in a jsx syntax definition like this: --syntax-definition=pandoc-jsx/jsx.xml

@jakoblind @jgm It may be stupid buuuut is there a pandoc-jsx/jsx.xml somewhere now ?

Was this page helpful?
0 / 5 - 0 ratings