ivanceras / svgbob

Convert your ascii diagram scribbles into happy little SVG
http://ivanceras.github.io/svgbob-editor/
Apache License 2.0
3.88k stars 109 forks source link

Ampersands in text break exported SVGs #113

Open alilleybrinker opened 3 months ago

alilleybrinker commented 3 months ago

In an exported SVG which you may, for example, want to render with an <img> tag in an HTML document, the ampersand is expected to be encoded with &amp;. Right now, the SVG exports does not do this encoding, so an exported SVG with an ampersand can't be used in an HTML <img> tag without first modifying the ampersand manually.

Here's an example input which produces the broken SVG output:


                                                      +-----------------+
                                             Measures |                 | Score & Recommendation
                                            +-------->|  Configuration  |-----------------------+
 +----------------+          +------------+ |         |                 |                       |         +----------+
 |                |   Data   |            |-+         +-----------------+                       |         |          |
 |  Data Sources  |--------->|  Analyses  |                                                     +-------->|  Output  |
 |                |          |            |-+                                                   |         |          |
 +----------------+          +------------+ |                                                   |         +----------+
                                            +---------------------------------------------------+
                                                                   Concerns