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

Allow explicit label escaping? #19

Closed fmthoma closed 6 years ago

fmthoma commented 6 years ago

Some labels contain characters (or character combinations) that are rendered as paths, although this might not be intended by the user. Currently, there does not seem to be a way to prevent this (correct me if I'm wrong?).

Example:

+---------+
| a.to(b) |
+---------+

The o( in to(b) are rendered as a small circle and an arc of a bigger circle, rather than the characters o and (.

Proposal:

Add the possibility to escape labels, e.g. using backticks. Everything between backticks within one line will be rendered as text (single label, with normal word spacing):

+---------+
|`a.to(b)`|
+---------+
ivanceras commented 6 years ago

I don't have time to work on this in the meantime. PR are welcome

ivanceras commented 6 years ago

@fmthoma I just realized that you can already do this via double quote | "a.to(b)" |. It will escape parsing text that are in between the quotes

fmthoma commented 6 years ago

@ivanceras Thanks for the hint! I've just tried it, and (at least in the editor), the rest of the line after the closing " is ignored:

+-----------+---+
| "a.to(b)" | c |
+-----------+---+

renders like

+-----------+---+
| "a.to(b)"
+-----------+---+

Strangely, an empty label at the end of the line fixes the problem:


+-----------+---+
| "a.to(b)" | c |""
+-----------+---+