(tag: MetaDefinition)
| 199 | } |
| 200 | |
| 201 | function parseSelector(tag: MetaDefinition): string { |
| 202 | const attr: string = tag.name ? 'name' : 'property'; |
| 203 | return `${attr}=${escapeSelectorValue(String(tag[attr]))}`; |
| 204 | } |
| 205 | |
| 206 | function escapeSelectorValue(value: string): string { |
| 207 | // Escape backslashes and double quotes to prevent CSS selector injection. |
no test coverage detected