mgaitan / sphinxcontrib-mermaid

Mermaid diagrams in yours sphinx powered docs
http://sphinxcontrib-mermaid-demo.readthedocs.io/en/latest/
Other
338 stars 96 forks source link

Umlauts causing error on build #81

Open sgaechter opened 2 years ago

sgaechter commented 2 years ago

Umlauts, as common in German Language (like: ä, ö, ü) causing problems buildung Sphinx Docs. The infected Charts are replaced by "Syntax error in graph mermaid version 8.13.7":

Error Message displayed in Doc: Error

As soon as all umlauts are replaced, the graphs will be displayed as expected. Tested make commands: html, latexpdf

Example:

`.. mermaid::

flowchart LR a(Kundeninput) --> b(Product-Backlog) --> c(Sprintplanung) --> e("Sprint (2-4 Wochen)") --> f(Sprint-Review) --> g([Zum Veröffentlichungsprozess]) e --> d(Sprint-Retrospektive) --> c`

When I build the mermaid chart with mermaid-cli the umlauts are built correct (see output.png below): output

used version: Master (a6c1f8b9dc3e84cde8e2658856c0668dc47324db)

mgaitan commented 2 years ago

I've tested this and looks ok

image

sgaechter commented 2 years ago

@mgaitan The Screenshot with the diagram you see in my Post is not the result in the rendered sphinx doc. I've rendered this with the online tool. Mermaid still throws an error and only the Error - Placeholder is shown in the doc.

mgaitan commented 2 years ago

@sgaechter the screenshot I've posted was after copying/pasting your diagram code in a .rst file and then building html with sphinx. Is it not the issue reported? In such a case, could you share an online example of a source and the produced html

sgaechter commented 2 years ago

@mgaitan I tested the output again. Unfortunately, either the HTML or latexpdf is rendered correctly on my side: Source meermaid sourcecode HTML: meermaid-Chart html

latexpdf: meermaid-Chart latexpdf

as soon as I replace the umlaut "ö" to "oe " the rendering works as expected: HTML: mermaid-Chart html_noumlauts

latexpfdf mermaid-Chart latexpdf_noumlauts

Attached you can find the full source code of the sphinx-Project. I'd be pleased if somebody can tell me what's wrong. source.zip

Used versions in requirements.txt

Thanks Sven source.zip

sgaechter commented 2 years ago

I've tested to set the Word with umlauts in Colons: g(["Zum Veröffentlichungsprozess"]). This resulted in the output no longer bringing an error. However, the character encoding does not seem to be correct: HTML: meermaid-Chart_html_colon

latexpdf: meermaid-Chart html_colon

I also added the directive source_encoding = 'utf-8-sig' to config.py, with no effect.

sgaechter commented 1 year ago

Issue still open also with latest release.

cstmth commented 4 months ago

This is still a problem. The following line in a sankey-beta diagram causes a Diagram syntax error:

Kein Angebot, hätte angenommen, 3

Error: Error: Parse error on line 17: ...t, 1Kein Angebot, hätte angenommen, 3 ----------------------^ Expecting 'NEWLINE', 'EOF', 'COMMA', got 'NON_ESCAPED_TEXT'