Changeset 61180
- Timestamp:
- 11/07/2025 02:42:41 PM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/js/_enqueues/vendor/twemoji.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/vendor/twemoji.js
r61134 r61180 4 4 https://github.com/jdecked/twemoji/blob/gh-pages/LICENSE 5 5 */ 6 7 /* 8 * Note: this file was modified in two places to add support for a doNotParse() callback. 9 * The modifications are surrounded by `// WP start` and `// WP end` comments. 10 */ 6 11 7 12 // WARNING: this file is generated automatically via … … 306 311 else if (nodeType === 1 && !('ownerSVGElement' in subnode) && 307 312 !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) { 313 314 // WP start 315 // Use doNotParse() callback if set. 316 if ( twemoji.doNotParse && twemoji.doNotParse( subnode ) ) { 317 continue; 318 } 319 // WP end 320 308 321 grabAllTextNodes(subnode, allText); 309 322 } … … 521 534 how = {callback: how}; 522 535 } 536 537 // WP start 538 // Allow passing of the doNotParse() callback in the settings. 539 // The callback is used in `grabAllTextNodes()` (DOM mode only) as a filter 540 // that allows bypassing of some of the text nodes. It gets the current subnode as argument. 541 twemoji.doNotParse = how.doNotParse; 542 // WP end 543 523 544 // if first argument is string, inject html <img> tags 524 545 // otherwise use the DOM tree and parse text nodes only
Note: See TracChangeset
for help on using the changeset viewer.