MCPcopy Index your code
hub / github.com/angular/angular / _escapeSelectorValue

Method _escapeSelectorValue

packages/platform-browser/src/browser/meta.ts:194–198  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

192 }
193
194 private _escapeSelectorValue(value: string): string {
195 // Escape backslashes and double quotes to prevent CSS selector injection.
196 // This securely confines the value inside an attribute selector.
197 return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
198 }
199
200 private _containsAttributes(tag: MetaDefinition, elem: HTMLMetaElement): boolean {
201 return Object.keys(tag).every(

Callers 1

_parseSelectorMethod · 0.95

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected