-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Field flow: Handle HTML tags in unlinked list items
Previously, when the plugin encountered list items that didn't start off with an anchor, it used each item's first child node as a label/value. That was fine if the only child was a text node. But not when nested elements were in play... For example: * If a list item's first child node was an element node, wb.escapeAttribute() raised the following JS exception (since it expects strings - not element nodes): * Uncaught TypeError: can't access property "replace", str is null * If a list item started off with a text node and was followed by any element nodes, only the text node's content would be retained... resulting in the rest of the content getting truncated This fixes it by deriving list item labels from their inner HTML code (like what's already done for anchors), as well as stripping HTML tags out of option elements and value attributes. HTML formatting is retained for checkbox/radio button labels. Also updated examples to demonstrate affected scenarios: * Redirection example: * Bold a link in a list item * Other examples: * Add italics/bolding in all "(Set 5)"/"(Ensemble 5)" list items
- Loading branch information
1 parent
74b26eb
commit 962229c
Showing
7 changed files
with
71 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.