(value: string, marker: InlineMarker)
| 207 | node instanceof Element && ['em', 'i'].includes(node.tagName.toLowerCase()); |
| 208 | |
| 209 | const wrapLines = (value: string, marker: InlineMarker): string => |
| 210 | value |
| 211 | .split('\n') |
| 212 | .map((line) => { |
| 213 | const content = line.trim(); |
| 214 | |
| 215 | if (!content) { |
| 216 | return line; |
| 217 | } |
| 218 | |
| 219 | const leading = line.slice(0, line.indexOf(content)); |
| 220 | const trailing = line.slice(leading.length + content.length); |
| 221 | |
| 222 | return `${leading}${marker}${content}${marker}${trailing}`; |
| 223 | }) |
| 224 | .join('\n'); |
| 225 | |
| 226 | // Mutually recursive functions for inline serialization |
| 227 | function serializeChildren(node: Element): string { |
no outgoing calls
no test coverage detected