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

New lines inside code macro are lost when saving

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.8 RC1
    • 1.8 M2
    • WYSIWYG Editor
    • None
    • any
    • new lines lost code macro convert
    • Unit, Integration

    Description

      Write the following in the Wiki editor:

      {{code}}
      function foo() {
          alert('bar');
      }
      {{/code}}
      

      Then switch to WYSIWYG editor. You'll get:

      <!--startmacro:code|-||-|
      function foo() {
          alert('bar');
      }
      --><div class="box code"><tt class="wikimodel-verbatim">function foo() {
          alert('bar');
      }</tt></div><!--stopmacro-->
      

      Then if you switch back to Wiki editor you'll notice the new lines inside the code macro are lost:

      {{code}}function foo() {    alert('bar');}{{/code}}
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: