slachiewicz commented on PR #1087:
URL: https://github.com/apache/maven-doxia/pull/1087#issuecomment-5528095821

   Yes. Verified by running the pattern rather than reading it:
   
   | input | result |
   | --- | --- |
   | `<object type="image/svg+xml" data="x.svg"/>` | closed |
   | `<object` + newline + `type="…"` + newline + `data="x.svg"/>` | closed |
   | `<object data="a` + newline + `b"/>` (newline inside a quoted value) | 
closed |
   | `<br/>`, and `<img` + newlines + `src="a.png"/>` | left alone, correctly |
   | `<object data="a"/><object data="b"/>` | both closed |
   
   Multi-line works because the pattern contains no `.`, so DOTALL never comes 
into it. The
   attribute group is built from `"[^"]*"`, `'[^']*'` and `[^"'/>]`, and in 
Java all three match a
   newline, as does the `\s*` before `/>`.
   
   Code blocks are safe for a separate reason worth recording: flexmark escapes 
their content, so
   `&lt;object/&gt;` never matches and a literal example in a fenced block is 
not rewritten.
   
   Testing it did turn up one case it misses, though — an unquoted attribute 
value containing a
   slash:
   
       <object data=x/y.svg/>   ->   unchanged
   
   `/` is excluded from every branch of the attribute group, so the match can 
never reach the
   trailing `/>`. HTML permits unquoted attribute values and flexmark passes 
raw HTML through
   verbatim, so that input still hits the original bug. Narrower than the 
multi-line case you asked
   about, but it is the real hole. Happy to either handle it or record it as a 
known limitation with
   a test — your call which.
   
   *This comment was created with AI assistance.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to