Menu

#228 svg incorrectly not marked as phrasing content in HTML5

v2.30
open-accepted
nobody
None
5
2024-03-01
2021-12-22
No

In HTML5, the <svg>-tag is phrasing content according to the specification. However, HTMLCleaner doesn't include it in the definition of PHRASING_TAGS and adds CLOSE_BEFORE_TAGS to svg which means that for example the following HTML code

<p><svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" fill="red" r="40" stroke="black" stroke-width="2"></circle>
</svg></p>

is incorrectly cleaned as

<p></p><svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" fill="red" r="40" stroke="black" stroke-width="2"></circle>
</svg>

Discussion

  • Vincent Massol

    Vincent Massol - 2023-04-20

    Hi @scottwilson. Long time no speak! How are you?

    We have several issues reported quite a while ago, like this one (also reported at https://sourceforge.net/p/htmlcleaner/bugs/231/) or https://sourceforge.net/p/htmlcleaner/bugs/230/ and are wondering if we could expect some fixes.

    Anything we could do to help out?

    Thank you very much, you've always been very helpful to the XWiki project.
    -Vincent

     
  • Scott Wilson

    Scott Wilson - 2023-04-21

    Hi both!

    Always happy to help. I'll take a look at these next week. If it's just a case of tweaking the tag provider and going through unit tests that shouldn't take much work. I was away from the project for a while (lots happening in the day job) and then found it hard to get back into it again as new versions of Eclipse were making things rather difficult.

    Since I moved over to IntelliJ I'm feeling a lot more productive, and that I can now dip back into HC and start fixing things again with a better tempo!

     
  • Scott Wilson

    Scott Wilson - 2023-04-29
    • status: open --> open-accepted
    • Group: v2.26 --> v2.28
     
  • Scott Wilson

    Scott Wilson - 2023-04-29

    228 is now fixed and will be in release version 2.28. Odd coincidence!

     
  • Scott Wilson

    Scott Wilson - 2023-06-19
    • Group: v2.28 --> v2.30
     
  • Simon Urli

    Simon Urli - 2024-03-01

    @scottwilson it seems you forgot to close that one: I can see a commit related to it before release 2.28, see https://sourceforge.net/p/htmlcleaner/code/595/

     

Log in to post a comment.

MongoDB Logo MongoDB