mraible opened a new pull request, #353:
URL: https://github.com/apache/roller/pull/353

   This builds on #318, which adds jsoup, so its diff includes #318's commits 
until that merges. The new commit is c7e255b89.
   
   The HTML subset, used by the default HTMLSubset comment plugin and by HTML 
comment notification e-mails, was built with regular expressions. The comment 
was HTML-encoded, then 21 patterns turned the encoded tags in the subset back 
into tags and rebuilt links. Now:
   
   - `Utilities.sanitizeToHTMLSubset` runs jsoup's `Cleaner` with a `Safelist` 
of the same tags (`a`, `b`, `blockquote`, `br`, `i`, `li`, `ol`, `p`, `pre`, 
`ul`) and the same link schemes (`http`, `https`, `mailto`) on the raw HTML.
   - The HTMLSubset plugin and the notification e-mails call it directly.
   - `transformToHTMLSubset` stays for templates 
(`$utils.transformToHTMLSubset`). It decodes its HTML-encoded input and then 
cleans it.
   - The 21 patterns and `restoreSubsetEntities` are removed.
   
   What changes for commenters:
   
   - A tag outside the subset is removed and its text kept, instead of being 
shown as encoded markup. Script and style contents are removed.
   - A link keeps its `href` when it has other attributes, such as a `title`. 
The other attributes are removed.
   - The output is jsoup's: tags are balanced, `<br>` has no slash, and the 
link scheme is lowercase.
   
   The new tests cover script, style, event handler, `javascript:` and `data:` 
links, an entity-split `javascript:` scheme, SVG, inline styles, HTML comments, 
iframes, and a quote inside an `href`. The full unit suite passes (770 tests).
   
   6.1.x keeps its current HTML subset code.


-- 
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