schplurtz / a2s

DokuWiki asciitosvg plugin
GNU General Public License v2.0
3 stars 1 forks source link

escaping special characters #9

Closed twistylittleworkshop closed 4 years ago

twistylittleworkshop commented 4 years ago

Hi,

Is it possible to escape special characters, e.g. "o", as they can interact with box characters. In this excerpt (from a closed box): --+----+----+--- fox -+-----------+---

The "o" in fox becomes a line connector because of the + above it? A workaround might be using another "o" from unicode, but that may be against the ascii-art ethos :)

schplurtz commented 4 years ago

Hi,

Thanks for your report. Your text was not properly formatted. I assumed you meant that

  |    |    |
--+----+----+---
  |   fox   |
 -+-----------+---
  |           |

The short answer is no. If it looks connected, it is connected. There is no way around that.

Imagine you write \o to mean a non connecting o, then the ASCII version would just look weird and different from the SVG version (and you don't gain anything as the \ uses one char. You could as well add a space in order to move "fox" left or right). Moreover, the direct mapping of one ASCII char for one SVG "char" would break. You now have an ASCII line with more char than you would have in the SVG output. I cannot imagine any clean way to solve this. (move left ? right ? . Suppress the whole column ?). It could be possible to add a an option for no connecting-o-in-this-drawing, but this means modifying the underlying ASCII2SVG library, which I am very reluctant to do because I don't really understand its internals, and I don't have the skill to do it cleanly.

Please note that Uppercase O is not a connecting char. so this works as expected.

  |    |    |
--+----+----+---
  |   FOX  |
 -+-----------+---
  |           |

Even if you insist on using lower case o, In this precise case, it is easy to solve the problem. Just shift fox one char left or right. I realize there are situations where you'd have to add a whole line or column. And I remember having to do this. This is just the way it is.

I hope you understand why I will mark this "won't fix" and close the issue. I may tkae some time to improve the doc, though.