0 Replies Latest reply: Jan 29, 2013 3:36 PM by prbsparx RSS

    What is the proper syntax for Dreamweaver to recognize a multi-line python comment ("""...""")?

    prbsparx Community Member

      I've created an extension that provides syntax recognition and code coloring for the Python programming language.

       

      The one item that will not color-code properly is a multi-line comment. A multi-line comment in Python is:

       

      """
      Enter some text here
      """
      

       

      The XML I'm using is:

       

      <commentStart MMString:name="myPython/CodeColor_Comment" id="CodeColor_PythonComment"><![CDATA["""]]></commentStart>
      <commentEnd><![CDATA["""]]></commentEnd>
      <endOfLineComment><![CDATA[#]]></endOfLineComment>
      

       

      The Multi-line comment start works fine. The Multi-line comment end does not.

       

      Comments are set to a grey color. Strings are set to orange, so what happens when I do a multi-line comment is:

       

      import sys


      """

      Here is a comment

      """

       

      sys.path.insert(1,'/path/to/file/')

      ...

       

      What it should look like is:

       

      import sys


      """

      Here is a comment

      """

       

      sys.path.insert(1,'/path/to/file/')

      ...


      Any ideas?