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

Escaping { into {{ '{' }}? #3

Closed
SamuelMarks opened this issue Oct 16, 2018 · 0 comments
Closed

Escaping { into {{ '{' }}? #3

SamuelMarks opened this issue Oct 16, 2018 · 0 comments

Comments

@SamuelMarks
Copy link

SamuelMarks commented Oct 16, 2018

Nice work with marked-ts!


Wrote a little script to allow Angular to support Markdown, using marked-ts.

Given b.component.md:

## Hello
<div *ngIf="true">
```bash
echo ${5}
```
</div>

It generates:

<h2 id="hello">Hello</h2>
<div *ngIf="true">
<code>bash
echo ${5}</code>
</div>

How would I escape things Angular doesn't support?

Namely, I want to generate:

<h2 id="hello">Hello</h2>
<div *ngIf="true">
<code>bash
echo ${{'{'}}5{{'}'}}</code>
</div>

EDIT_0: I can't escape with NgNonBindable due to angular/angular#11859
EDIT_1: Wrote a very basic custom post processing for this:
https://github.com/SamuelMarks/ng-md-components/blob/ceec9783881a2864fe5e2fff82bec115895733de/index.ts#L73-L91

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

No branches or pull requests

1 participant