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

Feature Request: Pre-render hook #13

Closed
JohnArrowwood opened this issue Nov 28, 2017 · 3 comments
Closed

Feature Request: Pre-render hook #13

JohnArrowwood opened this issue Nov 28, 2017 · 3 comments

Comments

@JohnArrowwood
Copy link

JohnArrowwood commented Nov 28, 2017

I need to be able to hook into the preview of the contents, and interpolate values before the Markdown is interpreted.

For example, if the contents looks something like this:

This is my little document, and {{variable}} 
should be replaced with the contents of `variable`

Then I want the value of {{variable}} to be interpolated to <span class=variable-value>theValue</span> before the Markdown processing begins.

I'd like to request the ability to specify [preRender]="myFilter" to have my function called on the value of the markdown text prior to passing it to the markdown renderer.

@instance-oom
Copy link
Owner

I will consider this carefully.

@instance-oom
Copy link
Owner

I will support this feature soon

@instance-oom
Copy link
Owner

@JohnArrowwood Please use ngx-makdown-editor@1.1.6
Usage:

[preRender]="preRender"

preRender(content) {
    return (content || '').replace(/Taks/g, 'dasdad');
}

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

2 participants