Open dannwebster opened 8 years ago
I was working on this issue in my fork, but have major problems getting the tests to run. I had to set the this.timeout(20000)
to get them to run, and then they take forever. Suggestions?
I fixed this problem on my project https://github.com/vliejo/gitbook-plugin-local-plantuml/pull/5
Issue Description
The text in a PlantUML "block" seems to be HTML escaped/encoded, so when the text is extracted from the block in the plugin, it is passed on to PlantUML changed from what was originally written.
It looks like the Gitbook framework automatically encodes the "block" text. This may not have happened for an ealier version of gitbook.
Steps to Reproduce
If I write this in my .md document:
This plugin tries to render this text:
That then generates this file
The cause of issue is that for this text:
The
block
object encodes the text (escaping parentheses, for example), and gives the plantuml.jar this:Similarly this
Stage <\|-- Timespent
gets an html escape of the<
character to a<
and becomesStage <\|-- Timespent
Details
Here is the problematic section of code (from
gitbook-plugin-local-plantuml/index.js
, lines 17-25):The line
gets text that is already escaped. As far as I can tell, the
block
object does not contain any reference to the un-encoded text. It also does not contain any line-numbers, or any other way determine the text which generated the initial block.The alternate Gitbook PlantUML plugin uses regexes to extract the text, which seems cumbersome, but might be the only way to get ahold of the unchanged text.