FIXTradingCommunity / tablature

Easy authoring for rules of engagement using markdown
https://www.fixtrading.org/
Apache License 2.0
11 stars 8 forks source link

[orchestra2md] not translating all special characters in markdown #46

Closed donmendelson closed 3 years ago

donmendelson commented 3 years ago

Some characters, especially the pipe character, are normal characters in XML but are special in markdown. It must be escaped with backslash in markdown as "\|" to be treated as a regular character.

Some examples use the pipe character to represent a field delimiter in FIX.

<fixr:documentation purpose="EXAMPLE">723 in field 21 would be mapped int as |21=723|. -723 in field 12 would be mapped int as |12=-723|.</fixr:documentation>

Another use of the pipe is for datatype patterns.

<fixr:mappedDatatype standard="XML" base="xs:string" builtin="0" pattern="\d{4}(0|1)\d([0-3wW]\d)?">

Two solutions are possible:

  1. Escape pipe or other special character with backslash in markdown as \|
  2. Turn the whole string into a literal with backticks like
    `\d{4}(0|1)\d([0-3wW]\d)?`

Solution 1 is already done for some documentation but seems not be working for the examples. (Also, there is some reverse translation from markdown to XML in md2orchestra.) Solution 2 seems viable for pattern and the like where special characters are likely to be used without modifying the pattern itself.

donmendelson commented 3 years ago

VS Code just added a feature to render the following characters from markdown. Some are worth considering for Tablature. Interestingly, they are using a section mark for a paragraph break since you can't insert line breaks in a markdown table. We considered that before.

Simple typographic replacements (c) (C) → ©// (tm) (TM) → ™// (r) (R) → ®// +- → ±// (p) (P) -> §// ... → … (also ?.... → ?.., !.... → !..)// ???????? → ???, !!!!! → !!!, ,,,// -- → &ndash;, --- → &mdash;