Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20484

The source syntax used by CKEditor is always the syntax of the current / edited document

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.0-rc-1, 14.10.2
    • 14.4.6
    • CKEditor
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Load the CKEditor using:

      {{velocity}}
      #set ($editedContent = '<h1>Hi there!</h1><p>This is a test.</p>')
      #set ($syntax = $services.rendering.resolveSyntax('html/5.0'))
      {{html clean="false"}}
      $!services.edit.syntaxContent.wysiwyg($editedContent, $syntax, {
        'id': 'test',
        'name': 'test'
      })
      {{/html}}
      {{/velocity}}
      

      On a page that has XWiki 2.1 syntax. Then switch to Source. You get:

      = Hi there! =
      
      This is a test.
      

      While it should have been something like:

      <h1 id="HHithere21" class="wikigeneratedid"><span>Hi there!</span></h1><p>This is a test.</p>
      

      The problem is that even if we specify html/5.0 when loading the editor, it still using the syntax of the current document.

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: