Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow explicit label escaping? #19

Closed
fmthoma opened this issue Dec 26, 2017 · 3 comments
Closed

Allow explicit label escaping? #19

fmthoma opened this issue Dec 26, 2017 · 3 comments

Comments

@fmthoma
Copy link
Contributor

fmthoma commented Dec 26, 2017

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
Copy link
Owner

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

@ivanceras
Copy link
Owner

@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
Copy link
Contributor Author

fmthoma commented Jan 5, 2018

@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 |""
+-----------+---+

fmthoma added a commit to fmthoma/svgbobrus that referenced this issue Feb 9, 2018
svgbob will render strings in double quotes literally, and not replace any
characters by svg paths.

However, as mentioned in ivanceras#19, there is currently a bug that the last part of a
line after the last closing double quote character is ignored:

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

renders like

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

which is fixed in this pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants