Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
This HTML in our ASPX-page:
<script id="itemTmpl" type="text/html">
<li data-bind="style: { 'margin-left': $data.Children == null ? '-28px' : '0' }">
<!-- ko if: $data.Children != null -->
<div style="line-height: 28px" data-bind="text: VisningsNamn"></div>
<!-- /ko -->
<!-- ko if: $data.Children != null -->
<ul style="margin-left: 30px" data-bind="visible: $data.Children != null, template: { name: 'itemTmpl', foreach: $data.Children }"></ul>
<!-- /ko -->
</li>
</script>
Becomes
<script id="itemTmpl" type="text/html">
<li data-bind="style: { 'margin-left': $data.Children == null ? '-28px' : '0' }">
<!-- ko if: $data.Children != null --></></script></div>-- /ko -->
<!-- ko if: $data.Children != null -->
<ul style="margin-left: 30px" data-bind="visible: $data.Children != null, template: { name: 'itemTmpl', foreach: $data.Children }"></ul>
<!-- /ko -->
After EPI has processed it.
I have the exact same problem as described in URL rewriter crashes knockout.js templates: http://world.episerver.com/forum/developer-forum/EPiServer-CMS-6-R2/Thread-Container/2013/3/URL-rewriter-crashes-knockoutjs-templates/, but we are running EPI Server 9.6.
The short version is that the UrlRewriter messes upp the HTML comments inside the script-tag. I have tried to add a custom UrlRewriter as described in the post above, but I never get the complete HTML from the Script-tag and therefor the Regex never gets a match. I have tried to wrap all my Templates within a div with a EpiNoRewrite="true" attribute without success.
How can I prevent the UrlRewriter to mess with my HTML?
Thanks, Eric