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 authors to use render syntax with curly braces {{ content }} #1206

Closed
crphang opened this issue Apr 18, 2020 · 1 comment · Fixed by #1220
Closed

Allow authors to use render syntax with curly braces {{ content }} #1206

crphang opened this issue Apr 18, 2020 · 1 comment · Fixed by #1220

Comments

@crphang
Copy link
Contributor

crphang commented Apr 18, 2020

Currently authors have no way to render {{ content }} easily due to Vue. The only workaround is adding appropriate span tags

<span>{</span>{ content <span>}</span>}.

Rendering such syntax could be required for certain authors attempting to teach various Domain Specific Language that could contain such syntax, one example is Latex.

With work on #1049 and #1047, MarkBind currently allows special tags that retains curly braces instead of being removed from Nunjucks over repeated rendering if {% raw %} {% endraw%} is being used. However, due to Vue, we are still unable to render {{ }} as it is being used for interpolation. See: vuejs/vue#4223.

A possible experience to overcome that would be to introduce a new plugin:

<escape>
{%raw%}
{{ any content }} 
{%endraw%}
</escape>

Would be even better if <escape> automatically adds required nunjucks escaping.

References and potential solution:

#1049 (comment)

For general use, we could create a special component, something like that acts the same as a in addition to appending {% raw %} {% endraw %}

@crphang
Copy link
Contributor Author

crphang commented Apr 18, 2020

To add on to the proposed possible solution, it might not be necessary to use special tag in this, but doing so can have a consistent solution to solve #1196 which is due to markdown-it-attr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant