jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34k stars 3.34k forks source link

Better code conversion from ODT #4841

Open danse opened 6 years ago

danse commented 6 years ago

In order to detect code formatting in an ODT document, pandoc currently recognises the Source_Text value for the style-name attribute, but this is not the value used by the styles i have available with Libreoffice 5. I can use Preformatted Text for paragraphs and Source Text among the "character styles" that is inlines. They get encoded as Preformatted_20_Text and Source_20_Text values for the style names.

Paragraphs aren't converted to code blocks even when they have the expected style, so there is no way to write a code snippet with meaningful indentation in ODT and convert it with pandoc

jgm commented 6 years ago

I suspect this would be an easy change; just search for "Source_Text" in the code...

danse commented 6 years ago

yes it's easy to add more styles. I'm also looking for a way to convert code paragraphs, currently it doesn't work. Hopefully i will close this issue fixing both problems

danse commented 6 years ago

I am working at a version which takes your comments into account, on the 4841-4 branch on italia/pandoc. Anyway i won't have much time to work on that so i am going to merge the existing solution from branch 4841 in our fork. Just notifying here for other folks who might stumble on the same problem in the future