Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48905

atto_outdent removes blockquote tags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.9, 3.1
    • Fix Version/s: None
    • Component/s: HTML Editor (Atto)
    • Testing Instructions:
      Hide
      1. Run behat with @atto_indent
      2. Setup a page with various levels of indents inserted with atto editor indent button (include some lists)
      3. Add block quotes into the source using HTML source button at various levels of indents and save.
      4. In variety of browsers, go to your page and use the outdent button
      5. Verify that only editor indents are removed, not blockquotes.
      6. View HTML source and check that no empty or extra classes added or empty attributes are added.
      Show
      Run behat with @atto_indent Setup a page with various levels of indents inserted with atto editor indent button (include some lists) Add block quotes into the source using HTML source button at various levels of indents and save. In variety of browsers, go to your page and use the outdent button Verify that only editor indents are removed, not blockquotes. View HTML source and check that no empty or extra classes added or empty attributes are added.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-48905-master

      Description

      If you have HTML which contains an indented blockquote tag (the blockquote being inside the indent), then atto's outdent removes the blockquote before it removes the outdent.

      This is because all indents are converted to blockquotes, and then the outdent execCommand is called, which removes the inner-most blockquote tag. We then convert the remaining blockquotes back to divs.

      With Chrome this also will destroy div elements that have been inserted. For example include this HTML

      <div class="editor-indent" style="margin-left: 30px;"><div><p>paragraph one</p></div><div><p>paragraph two</p></div><div><p>paragraph three</p></div></div>

      Select one or more lines and outdent.
      Expected behaviour: Comple div element is outdented (indent removed)
      Actual behaviour: Div is removed from selected lines, only selected lines are outdented, inconsistent formating is applied.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dthies Daniel Thies
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Frédéric Massart
              Integrator:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated: