Yes, I wish to convert from latex to xml. I don't know much about pandoc filters and lua but they seem cool. I will see if I can get this to work. On Thursday, May 30, 2019 at 1:38:40 PM UTC-4, John MacFarlane wrote: > > John MacFarlane > writes: > > > Umut Acar > writes: > > > >> Indeed, it works for quite a few standard languages but are custom > language > >> definitions supported? In markdown -->html conversion via custom XML > >> spec's (Kate) seems possible. I got good results with that. Is this not > >> supported for LaTeX --> html? > > > > To be clear, do I understand correctly that you're > > converting from LaTeX to HTML, and you want LaTeX > > lstlistings environments to be converted with > > highlighting? > > > > That will work with recognized languages (those that > > lstlisting environment supports). And you can make > > it work with unrecognized languages, by using a filter. > > Note: > > > > % pandoc -f latex -t native > > \begin{lstlisting}[language=foobar] > > hi = 3 > > \end{lstlisting} > > ^D > > [CodeBlock ("",[],[("language","foobar")]) "hi = 3"] > > > > What you need to do highlighting (using > > --syntax-definitio=foobar.xml) is rather > > > > [CodeBlock ("",["foobar"],[]) "hi = 3"] > > > > The solution is to use a simple lua filter > > that finds code blocks with a language attribute and > > makes its value a class. > > Ultimately we may want to change pandoc so it > recognizes a language attribute if there is no > relevant class (feel free to put up an issue > about this), but this will work for now. > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d2d76f3d-e69a-4c98-81a7-4671370cbb66%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.