Editor - Problems with [align] BBCode

  • Affected App
    WoltLab Suite Forum

    When you use align BBCode to align several paragraphs (selecting all text) the Editor puts a BBCode in each paragraph. If I select all the text the opening BBCode should be in the start and the close BBCode in the final of the text (only one aling BBCode).


    Example:


    1.- WRONG (now)

    Code
    [align=justify]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vel diam ut sapien pharetra convallis. In a erat vitae quam cursus sagittis sed eget mi. Donec id libero egestas, iaculis lacus sit amet, egestas quam. Pellentesque egestas sollicitudin lacus id pulvinar. Fusce ac purus vel velit blandit maximus. Aliquam in maximus lacus. Integer tellus erat, tempor vel purus in, convallis aliquam ipsum. Quisque lacinia massa eget ligula condimentum, at malesuada erat euismod.[/align][align=justify]Sed non magna finibus, interdum neque non, fermentum urna. Ut efficitur nisi a quam hendrerit efficitur. Donec sit amet fringilla risus. Praesent fermentum urna eu lectus molestie imperdiet. Sed lacinia efficitur aliquam. Aliquam tortor libero, viverra sed euismod vitae, sollicitudin id odio. Fusce venenatis metus enim, nec placerat neque ultricies ut. Fusce velit urna, cursus id urna sit amet, vulputate placerat mi. Praesent eros lorem, commodo ut ultricies a, malesuada sed urna. Mauris tincidunt nec magna vel semper. Proin sit amet laoreet eros. Morbi eleifend venenatis orci accumsan lacinia. Vivamus elit tortor, vehicula sit amet dapibus ut, hendrerit a dui. Morbi venenatis enim dolor, nec viverra enim porttitor nec.[/align]


    Vs


    2.- CORRECT

    Code
    [align=justify]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vel diam ut sapien pharetra convallis. In a erat vitae quam cursus sagittis sed eget mi. Donec id libero egestas, iaculis lacus sit amet, egestas quam. Pellentesque egestas sollicitudin lacus id pulvinar. Fusce ac purus vel velit blandit maximus. Aliquam in maximus lacus. Integer tellus erat, tempor vel purus in, convallis aliquam ipsum. Quisque lacinia massa eget ligula condimentum, at malesuada erat euismod.
    
    
    
    
    Sed non magna finibus, interdum neque non, fermentum urna. Ut efficitur nisi a quam hendrerit efficitur. Donec sit amet fringilla risus. Praesent fermentum urna eu lectus molestie imperdiet. Sed lacinia efficitur aliquam. Aliquam tortor libero, viverra sed euismod vitae, sollicitudin id odio. Fusce venenatis metus enim, nec placerat neque ultricies ut. Fusce velit urna, cursus id urna sit amet, vulputate placerat mi. Praesent eros lorem, commodo ut ultricies a, malesuada sed urna. Mauris tincidunt nec magna vel semper. Proin sit amet laoreet eros. Morbi eleifend venenatis orci accumsan lacinia. Vivamus elit tortor, vehicula sit amet dapibus ut, hendrerit a dui. Morbi venenatis enim dolor, nec viverra enim porttitor nec.[/align]
    • Official Post

    The editor runs in paragraph mode and not in linebreaks mode. This is a huge difference because in paragraph mode each paragraph represents a distinctive node with not connection to any other adjacent node. The result of this is that the formatting is applied to each paragraph because HTML elements are not allowed to start and end in different nodes (that's the way HTML works). We've chosen this behavior because it offers a much more stable support in the browser's design mode.


    Your lower example shows the behavior in linebreaks mode because newlines are created by breaks which themselves are not block tags. As a result the formatting can legally span both paragraphs because they aren't actually paragraphs, they simply visually mimic them.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!