Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-648

Escaping before format syntax is not preserved

    XMLWordPrintable

Details

    • Unknown

    Description

      When starting a format with three characters (like ***) instead of two, the third character is inside the format. When escaping the first of the three characters, the additional character should be before the format. While this works, when rendering back to XWiki 2.0/2.1 syntax (e.g., because of saving in the WYSIWYG editor), the escaping is lost.

      Steps to reproduce:

      1. Edit a page in the WYSIWYG editor.
      2. Enter the text *bold text.
      3. Select the text bold text and apply bold formatting.
      4. Switch to source and change anything (e.g., add the word "part" after "text").
      5. Switch back to WYSIWYG.

      Expected result:

      The symbol * is still not bold.

      Actual result:

      The symbol * is now part of the bold text.

      This can also be reproduced with the following failing test case (the conversion back to the input value fails):

      .#---------------------------------------------------------------------------------------------------------
      .inputexpect|xwiki/2.0
      .# Validate that escaping before format start is preserved.
      .#---------------------------------------------------------------------------------------------------------
      ~***Bold test**
      ~---Strike through--
      .#-----------------------------------------------------
      .expect|event/1.0
      .#-----------------------------------------------------
      beginDocument
      beginParagraph
      onSpecialSymbol [*]
      beginFormat [BOLD]
      onWord [Bold]
      onSpace
      onWord [test]
      endFormat [BOLD]
      onNewLine
      onSpecialSymbol [-]
      beginFormat [STRIKEDOUT]
      onWord [Strike]
      onSpace
      onWord [through]
      endFormat [STRIKEDOUT]
      endParagraph
      endDocument
      .#-----------------------------------------------------
      .expect|annotatedxhtml/1.0
      .#-----------------------------------------------------
      <p>*<strong>Bold test</strong><br/>-<del>Strike through</del></p>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: