You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/22 19:29:47 UTC

[PR] WordToHtmlConverter: allow a custom hyperlink validator [poi]

pjfanning opened a new pull request, #1459:
URL: https://github.com/apache/poi/pull/1459

   Follow-up to #1455, addressing the review comments there.
   
   - `WordToHtmlConverter.setHyperlinkValidator(Predicate<String>)` (and getter) lets users add their own check on HYPERLINK field targets, e.g. to only link to some hosts. A rejected target keeps its text but is not written as a link.
   - The validator only applies to standard URLs: `WordToHtmlUtils.isSafeHyperlink` always runs first, so a custom validator can reject more targets but can never let a `javascript:` (or other script) target through. The default validator accepts everything that passes the built-in check, so output is unchanged.
   - `WordToHtmlUtils.isSafeHyperlink` is now public so callers can reuse it.
   - `testIsSafeHyperlink` now uses Hamcrest, so a failure lists every target that was classified wrongly instead of a bare `expected: <true>`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: [PR] WordToHtmlConverter: allow a custom hyperlink validator [poi]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1459:
URL: https://github.com/apache/poi/pull/1459


-- 
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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org