(settings: DomParserSettings, args: ParserArgs, isBlock: (node: AstNode) => boolean, node: AstNode)
| 5 | import type { SchemaMap, default as Schema } from '../api/html/Schema'; |
| 6 | |
| 7 | const paddEmptyNode = (settings: DomParserSettings, args: ParserArgs, isBlock: (node: AstNode) => boolean, node: AstNode): void => { |
| 8 | const brPreferred = settings.pad_empty_with_br || args.insert; |
| 9 | if (brPreferred && isBlock(node)) { |
| 10 | const astNode = new AstNode('br', 1); |
| 11 | if (args.insert) { |
| 12 | astNode.attr('data-mce-bogus', '1'); |
| 13 | } |
| 14 | node.empty().append(astNode); |
| 15 | } else { |
| 16 | node.empty().append(new AstNode('#text', 3)).value = Unicode.nbsp; |
| 17 | } |
| 18 | }; |
| 19 | |
| 20 | const isPaddedWithNbsp = (node: AstNode): boolean => |
| 21 | hasOnlyChild(node, '#text') && node?.firstChild?.value === Unicode.nbsp; |
no test coverage detected
searching dependent graphs…