mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
198 stars 55 forks source link

Bugfix: Don't add newlines in included files, fixes plantuml json support #97

Closed DaumAlexande closed 6 months ago

DaumAlexande commented 6 months ago

Currently the PlantumlIncluder adds the raw line (contains the line ending) to a list and then joins all those lines with extra newlines. This results in a blank line between each line.

Plantuml cannot parse some constructs (e.g. json variables) when there are blank lines in them.

With this PR, only stripped lines are added to the list, then joined by newlines, so no blank lines are added.

Examples of the problem:

Json parses correctly: https://www.plantuml.com/plantuml/uml/SoWkIImgAStDuL9KoIhEpuilIynHi5Mevb800gNir4ebAmKbe5XfgX9NBHTNeeAUdK8IbqDgNWfG3m00 Blank line causes json parsing to break: https://www.plantuml.com/plantuml/uml/SoWkIImgAStDuL9KoIhEpuilIynHi5Mevk9I00AbxDHA9Ii59Q1WQQeILoqNLwA2dfr24fT3QbuAK1C0

mikitex70 commented 6 months ago

Hi @DaumAlexande , thank you for the fix! Release in version 3.9.7,