(cooked: string, raw: string)
| 317 | * @throws an error if the `block` is unterminated |
| 318 | */ |
| 319 | export function splitBlock(cooked: string, raw: string): {text: string; block?: string} { |
| 320 | if (raw.charAt(0) !== BLOCK_MARKER) { |
| 321 | return {text: cooked}; |
| 322 | } else { |
| 323 | const endOfBlock = findEndOfBlock(cooked, raw); |
| 324 | return { |
| 325 | block: cooked.substring(1, endOfBlock), |
| 326 | text: cooked.substring(endOfBlock + 1), |
| 327 | }; |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | function computePlaceholderName(index: number) { |
| 332 | return index === 1 ? 'PH' : `PH_${index - 1}`; |
no test coverage detected
searching dependent graphs…