Uploaded image for project: 'Wiki Editor Tools'
  1. Wiki Editor Tools
  2. WIKIEDITOR-50

Syntax Highlighting breaks the wiki editor in Space Delimited code (python macro)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 4.2
    • 4.0
    • Syntax Highlighting
    • Xwiki 9.6/9.7, syntax highlighting application 4.0
    • N/A
    • N/A

    Description

      Assuming the following code:

      {{python}}
        square = 1
        pennies = 1
      
        while square <= 64:
            print "Square: %s Pennies: %s" % (square, square)
            if square == 1:
                quantity = "penny"
            else:
                quantity = "pennies"
      
            print "As of square %s you have %s %s." % (square, pennies, quantity)
            print ""
            square += 1
            pennies += square
      {{/python}}
      

      Highlighting works (in the wiki/code view), but parsing the script fails. Change the first line (square) to have no leading spaces, and the entire script 'vanishes'. Remove the extra spaces from the rest of it, and it will work again, but you won't be able to see the script without juggling through views to confuse the highlighter.

      As ruby is also tab/space delimited, ruby will most likely break with the same constraint. Looking at the documentation, all of the examples show the 2 spaces initial padding inside the code macro.

      Attachments

        Issue Links

          Activity

            People

              enygma Eduard Moraru
              daemoen Marc Mercer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: