mbest/knockout.punches

Feature Request: Add parsing of html inside of {{ }} and {{{ }}} binding syntax

DrSammyD opened this issue · 1 comments

So I was able to import markdown into views and still use knockout punches inside of that markdown, but I have one issue.

I'm trying to pass in some html as a parameter to a i18next function inside of my markdown
- {{{ko.t('welcome:Markdown',{link:"[markdown](#markdown)"})}}}

This is the output
<li>{{{ko.t('welcome:Markdown',{link:"<a href="#markdown">markdown</a>"})}}}</li>

Any chance of getting the interpolation to traverse that gap? I've been quite surprised so far that everything has worked with the markdown, but this is the only issue I've encountered so far.

I think this is just a little too advanced for Punches to be able to do. You can work around the problem by encoding the element, and you also need to be careful with the quotes:

<li>{{{ko.t('welcome:Markdown',{link:'&lt;a href="#markdown"&gt;markdown&lt;/a&gt;'})}}}</li>