instance-oom / ngx-markdown-editor

Angular markdown editor based on ace editor

Home Page:http://lon-yang.github.io/markdown-editor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Pre-render hook

JohnArrowwood opened this issue · comments

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.

commented

I will consider this carefully.

commented

I will support this feature soon

commented

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

[preRender]="preRender"

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