(text: string)
| 89 | } |
| 90 | |
| 91 | function createTextNodes(text: string): PhrasingContent[] { |
| 92 | if (!text) { |
| 93 | return []; |
| 94 | } |
| 95 | |
| 96 | const nodes: PhrasingContent[] = []; |
| 97 | const parts = text.split(/(`[^`]*`)/g); |
| 98 | |
| 99 | parts.forEach((part) => { |
| 100 | if (!part) { |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | if (part.startsWith("`") && part.endsWith("`")) { |
| 105 | nodes.push(createInlineCode(part.slice(1, -1))); |
| 106 | } else { |
| 107 | nodes.push(...createBracketAwareTextNodes(part)); |
| 108 | } |
| 109 | }); |
| 110 | |
| 111 | return nodes; |
| 112 | } |
| 113 | |
| 114 | function createBracketAwareTextNodes(text: string): PhrasingContent[] { |
| 115 | const nodes: PhrasingContent[] = []; |
no test coverage detected
searching dependent graphs…