tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/21882-fixing-broken-ampamp-rendering-from-javascript-creating-links-within-a-pageCascade CMS: Discussion 2016-05-31T17:20:29Ztag:help-archives.hannonhill.com,2010-02-09:Comment/397353242016-04-26T16:24:57Z2016-04-26T16:24:57Zfixing broken &amp; rendering from javascript creating links within a page.<div><p>On <a href="http://help.hannonhill.com/discussions/how-do-i/478-prevent-ampersands-in-javascript-from-being-encoded">
http://help.hannonhill.com/discussions/how-do-i/478-prevent-ampersa...</a>
it suggested code like</p>
<pre>
<code>function fixAmp(text) { return text.replace(/&amp;/g, '&');}</code>
</pre>
<p>in a .js file, but i found I could use an ugly hack within the
document:</p>
<pre>
<code>function fixAmp(text) { return text.replace(/amp;/g, '');}</code>
</pre>
<p>this breaks the escaping roughly but then it the dangling
ampersand gets re-escaped somehow.</p></div>Dave Forresttag:help-archives.hannonhill.com,2010-02-09:Comment/397353242016-05-05T19:51:12Z2016-05-05T19:51:12Zfixing broken &amp; rendering from javascript creating links within a page.<div><p>Hi Dave,</p>
<p>To confirm, are you seeing code on your page being encoded by
Cascade (e.g. JavaScript)? If so, you can also try surrounding the
code with <code><![CDATA[#protect ... #protect]]></code> tags
to bypass the content being encoded. More information can be found
<a href="http://www.hannonhill.com/kb/Code-Sections/#protect-code-sections-tags">
here</a>.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffith