BasicPolicy: allow the "wbr" tag for invisible word breaks#176
Open
jimklimov wants to merge 1 commit into
Open
BasicPolicy: allow the "wbr" tag for invisible word breaks#176jimklimov wants to merge 1 commit into
jimklimov wants to merge 1 commit into
Conversation
Tested in Firefox (editing the HTML preview area via F12 developer tools) that this tag is honoured to do word-breaks at HTML markup specified spots, and be a no-character when the rendered text is copied and pasted elsewhere. Other types of injected word breaks we've tried involve invisible/zero-width Unicode characters which remain in copied rendered text and confuse programs they are pasted into (e.g. new Jenkins job arguments, Slack, NotePad++) despite often remaining invisible on display. Applied `mvn spotless` formatting on top of the actual change. Signed-off-by: Jim Klimov <jimklimov+jenkinsci@gmail.com>
Author
|
A simple web-edited fix to add one word ended up with a need to get to a computer and check out code and run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested in Firefox (editing the HTML preview area via F12 developer tools) that this tag is honoured to do word-breaks at HTML markup specified spots, and be a no-character when the rendered text is copied and pasted elsewhere.
Other types of injected word breaks we've tried involve invisible/zero-width Unicode characters which remain in copied rendered text and confuse programs they are pasted into (e.g. new Jenkins job arguments, Slack, NotePad++) despite often remaining invisible on display.
For context, our internal pipeline library generates "Badges" (via
addShortTextand friends) with job milestones, crucial arguments, etc. so test jobs scheduled by different team members are easily identifiable in the "left column" listing. Those texts are often copied around to re-run a similar test setup, communicate with team members, etc. Sometimes the individual tokens in those badges are too long as an unbreakable word (e.g.VAR=VALUE) and the badge width overflows the left column width. All browsers have a different opinion on what the word-separating characters in an otherwise unformatted text stream are, and how to interpret CSS hints about that, so the most functional option that worked for us was to explicitly inject the word-break hints into the markup.But
<wbr/>did not work with Safe HTML due to the policy enhanced here, and various HTML entities and Unicode characters (e.g.​,​, or­possibly hidden into invisible<div>so it is NOT SEEN when used as a word-breaking hyphen) are not all that copy-paste friendly.Solutions tried were inspired by the https://stackoverflow.com/questions/15841109/optional-line-breaking-html-entity-that-is-always-invisible discussion
Experimental preview area (the "keywords" was originally spelled with
<br>tag so it would end up in the generated markup, and that was edited to<wbr>to test the browser rendering ability):wbractually injected there):Submitter checklist