•  
      request #40474 Section appears in "edited" state after artidoc loading
    Infos
    #40474
    Thomas Gorka (tgorka)
    2024-11-28 09:04
    2024-11-27 14:57
    42103
    Details
    Section appears in "edited" state after artidoc loading

    In Artidoc, when the content of a section contains trailing whitespaces, the DOMParser of ProseMirror will remove them.

    For instance, let's say that the section contains the following markup:

    <p>This is <a href="#">a link</a> </p>

    The editor's DOMParser will ignore the whitespace between the </a> and the </p> tag and produce the following markup:

    <p>This is <a href="#">a link</a></p>

     

    The artidoc section will then notice the difference and consider that its content has been updated, showing itself as "edited".

    ProseMirror's DOMParser accepts an option preserveWhitespace which can be false (default), true or "full".

    When true, the DOMParser will not remove the trailing whitespaces, and the section will not detect any change.

    Artidoc
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gorka (tgorka)
    Closed
    2024-11-28
    Attachments
    Empty
    References
    Referencing request #40474

    Follow-ups

    User avatar
    Thomas Gorka (tgorka)2024-11-27 15:02
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes