1 Reply Latest reply on Feb 25, 2010 10:52 AM by David_Powers

    How do I stop entity conversion?

    cowboy_rick

      I am building pages using both Dreamweaver templates and embedded perl code (via the Mason perl library). This is a very powerful combination but Dreamweaver is overzealous in converting special characters in editable regions into HTML entities. For example:

       

      This bit of Mason code checks to see if an attribute is defined:

      % if ($m->current_comp->attr_exists("myattr)) {

       

      If I put this in my template in a non-editable region, pages generated from the template get the code as it should be. However, if I put this code in an editable region, Dreamweaver converts the "unsafe" characters to named entities:

       

      <!-- InstanceBeginEditable name="chapter link" -->
      % if ($m-&gt;current_comp-&gt;attr_exists(&quot;myattrn&quot;)) {

      Of course, this generates an error at runtime.

       

      Is there anyway to force DW to NOT do this conversion?

       

      Thanks

        • 1. Re: How do I stop entity conversion?
          David_Powers Adobe Community Professional

          I don't know how the Perl code interacts with the rest of your page, but there are two ways of doing this:

          • Enclose the Perl code in HTML comment tags (but that might prevent your Perl from being processed).
          • Switch the DOCTYPE to HTML 4.01. Dreamweaver converts those characters to HTML entities to remain compliant with XHTML. It doesn't do the conversion with an HTML DOCTYPE.