(style: string)
| 162 | } |
| 163 | |
| 164 | function splitStyleDeclarations(style: string): string[] { |
| 165 | const declarations: string[] = []; |
| 166 | const scan: StyleDeclarationScan = { depth: 0, quote: null, skip: false }; |
| 167 | let start = 0; |
| 168 | for (let i = 0; i < style.length; i++) { |
| 169 | if (scan.skip) { |
| 170 | scan.skip = false; |
| 171 | continue; |
| 172 | } |
| 173 | const ch = style[i] ?? ""; |
| 174 | if (ch === ";" && scan.depth === 0 && scan.quote === null) { |
| 175 | declarations.push(style.slice(start, i)); |
| 176 | start = i + 1; |
| 177 | } else { |
| 178 | advanceStyleDeclarationScan(scan, ch, style[i + 1] ?? ""); |
| 179 | } |
| 180 | } |
| 181 | declarations.push(style.slice(start)); |
| 182 | return declarations; |
| 183 | } |
| 184 | |
| 185 | function parseStyleAttr(styleAttr: string): Record<string, string> { |
| 186 | const result: Record<string, string> = {}; |
no test coverage detected