joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

Is there support colons in replacement string? #86

Closed abhmul closed 1 year ago

abhmul commented 1 year ago

I am trying to do add the following replacement to the shorthand list:

tdiag:\begin{CD} A @>f>> B\\ @.     {_{\rlap{\ g\circ f}}\style{display: inline-block; transform: rotate(30deg)}{{\xrightarrow[\rule{4em}{0em}]{}}}} @VVgV\\  @. D \end{CD};

However, the ":" after display seems to be causing an issue with parsing. When doing replacement, nothing after "display" is included. Is there a way to allow parsing-related characters like ":" in the replacement string?

joeyuping commented 1 year ago

Hi! @abhmul

I have made some changes to allow for ":" in custom shorthand, by using ":::" as the delimiter instead of ":". However, to allow backward compatibility, the usual ":" delimiter still works, when there is no ":::" in the parameter.

Which means that, to have ":" inside the snippet, one will need to change all ":" in the original parameter into ":::".

Hope this works!