markbind icon indicating copy to clipboard operation
markbind copied to clipboard

Incorrect display of `{{ '{{' }}` and `{{ '}}' }}` as part of the `codeAndOutput.md` boilerplate

Open lhw-1 opened this issue 3 years ago • 1 comments

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

#2118, #2119

Tell us about your environment

Ubuntu 20.04

MarkBind version

4.0.2

What did you do? Describe the bug

This issue was initially brought up in PR #2118.

While trying to add the following snippet using the codeAndOutput.md boilerplate to the documentation for raw / endraw tags, the following compilation error occurred.

Code:

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code" id="list-example">
{{ '{{' }} '{{' {{ '}}' }} content {{ '{{' }} '}}' {{ '}}' }}
</variable>
</include>

Error:

Invalid expression: missing ) after argument list in
  _s(' {{ ')+" content "+_s(')+"  ' }}"
Raw expression: {{ ' {{ ' }} content {{ '  }}  ' }}

On the other hand, the following code snippet that removes one of the closing curly braces works as expected.

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code" id="list-example">
{{ '{{' }} '{{' {{ '}}' }} content {{ '{{' }} '}' {{ '}}' }}
</variable>
</include>

Output:

Screenshot from 2023-01-30 18-17-17

Steps to reproduce

Include the above code snippet (ensure that the codeAndOutput.md boilerplate is also included) into a pre-existing MarkBind site, and observe the displayed result.

Expected behavior

The output section should display {{ '{{' }} content {{ '}}' }}.

Actual behavior

The code snippet results in a compilation error.

Anything else?

No response

lhw-1 avatar Jan 30 '23 10:01 lhw-1

Boilerplate needs support for v-pre.

https://markbind.org/userGuide/tipsAndTricks.html

<include src="codeAndOutput.md" boilerplate >
<variable name="highlightStyle">markdown</variable>
<variable name="code" id="list-example">
<div v-pre>
{{ '{{' }} '{{' {{ '}}' }} content {{ '{{' }} '}}' {{ '}}' }}
</div>
</variable>
</include>

Or we should fix the underlying issue - v-pre isn't very user friendly or obvious..

ang-zeyu avatar Apr 26 '23 10:04 ang-zeyu