🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

angular-html-parser

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-html-parser - npm Package Compare versions

Comparing version
10.6.1
to
10.7.0
+11
dist/compiler/src/template/pipeline/src/namespaces.mjs
//#region ../compiler/src/template/pipeline/src/namespaces.ts
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
const MATH_ML_NAMESPACE = "math";
//#endregion
export { MATH_ML_NAMESPACE };
+21
-12

@@ -0,5 +1,6 @@

import { SECURITY_SCHEMA } from "./dom_security_schema.mjs";
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "../core.mjs";
import { isNgContainer, isNgContent } from "../ml_parser/tags.mjs";
import { isNgContainer, isNgContent, splitNsName } from "../ml_parser/tags.mjs";
import "../template/pipeline/src/namespaces.mjs";
import { dashCaseToCamelCase } from "../util.mjs";
import { SECURITY_SCHEMA } from "./dom_security_schema.mjs";
import { ElementSchemaRegistry } from "./element_schema_registry.mjs";

@@ -18,2 +19,6 @@ //#region ../compiler/src/schema/dom_element_schema_registry.ts

const OBJECT = "object";
function normalizeTagName(tagName) {
const [ns, name] = splitNsName(tagName.toLowerCase(), false);
return ns === "svg" || ns === "math" ? `:${ns}:${name}` : name;
}
/**

@@ -349,15 +354,17 @@ * This array represents the DOM schema. It encodes inheritance, properties, and events.

if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) return true;
if (tagName.indexOf("-") > -1) {
if (isNgContainer(tagName) || isNgContent(tagName)) return false;
const normalizedTag = normalizeTagName(tagName);
if (normalizedTag.includes("-")) {
if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) return false;
if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) return true;
}
return (this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown")).has(propName);
return (this._schema.get(normalizedTag) || this._schema.get("unknown")).has(propName);
}
hasElement(tagName, schemaMetas) {
if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) return true;
if (tagName.indexOf("-") > -1) {
if (isNgContainer(tagName) || isNgContent(tagName)) return true;
const normalizedTag = normalizeTagName(tagName);
if (normalizedTag.includes("-")) {
if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) return true;
if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) return true;
}
return this._schema.has(tagName.toLowerCase());
return this._schema.has(normalizedTag);
}

@@ -376,6 +383,6 @@ /**

if (isAttribute) propName = this.getMappedPropName(propName);
tagName = tagName.toLowerCase();
const normalizedTag = normalizeTagName(tagName);
propName = propName.toLowerCase();
const securitySchema = SECURITY_SCHEMA();
return securitySchema[tagName + "|" + propName] ?? securitySchema["*|" + propName] ?? 0;
return securitySchema[normalizedTag + "|" + propName] ?? securitySchema["*|" + propName] ?? 0;
}

@@ -406,7 +413,9 @@ getMappedPropName(propName) {

allKnownAttributesOfElement(tagName) {
const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get("unknown");
const normalizedTag = normalizeTagName(tagName);
const elementProperties = this._schema.get(normalizedTag) || this._schema.get("unknown");
return Array.from(elementProperties.keys()).map((prop) => _PROP_TO_ATTR.get(prop) ?? prop);
}
allKnownEventsOfElement(tagName) {
return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
const normalizedTag = normalizeTagName(tagName);
return Array.from(this._eventSchema.get(normalizedTag) ?? []);
}

@@ -413,0 +422,0 @@ normalizeAnimationStyleProperty(propName) {

@@ -9,6 +9,12 @@ //#region ../compiler/src/schema/dom_security_schema.ts

*/
/** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
/**
* Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'.
*/
let _SECURITY_SCHEMA;
const SVG_NAMESPACE = "svg";
const MATH_ML_NAMESPACE = "math";
/**
* @remarks Keep is a copy of DOM Security Schema.
* @see [SECURITY_SCHEMA](../../../compiler/src/schema/dom_security_schema.ts)
*/
function SECURITY_SCHEMA() {

@@ -90,7 +96,3 @@ if (!_SECURITY_SCHEMA) {

);
registerContext(5, SVG_NAMESPACE, [["script", [
"src",
"href",
"xlink:href"
]]]);
registerContext(4, SVG_NAMESPACE, [["a", ["href", "xlink:href"]]]);
registerContext(6, SVG_NAMESPACE, [

@@ -97,0 +99,0 @@ ["animate", [

{
"name": "angular-html-parser",
"version": "10.6.1",
"version": "10.7.0",
"description": "A HTML parser extracted from Angular with some modifications",

@@ -5,0 +5,0 @@ "repository": "https://github.com/prettier/angular-html-parser",