(string: SpannedString<string>)
| 5 | } |
| 6 | |
| 7 | function apply(string: SpannedString<string>) { |
| 8 | return Array.from(string.iterSubstrings()) |
| 9 | .map(([substring, tags]) => { |
| 10 | let s = substring; |
| 11 | for (const tag of tags) { |
| 12 | s = `<${tag}>${s}</${tag}>`; |
| 13 | } |
| 14 | return s; |
| 15 | }) |
| 16 | .join(''); |
| 17 | } |
| 18 | |
| 19 | function format(string: string, spans: [number, number, string][]) { |
| 20 | const s = S().appendString(string); |
no test coverage detected