MCPcopy
hub / github.com/webpack/webpack / shouldUseForeignRules

Function shouldUseForeignRules

lib/html/syntax.js:5188–5219  ·  lib/html/syntax.js::shouldUseForeignRules
(
		/** @type {HtmlElement} */ ac,
		/** @type {Token} */ t
	)

Source from the content-addressed store, hash-verified

5186 };
5187
5188 const shouldUseForeignRules = (
5189 /** @type {HtmlElement} */ ac,
5190 /** @type {Token} */ t
5191 ) => {
5192 if (ac.namespace === NS_HTML) return false;
5193 if (t.type === TOKEN_START_TAG) {
5194 if (
5195 mathmlTextIntegrationPoint(ac) &&
5196 t.name !== class="st">"mglyph" &&
5197 t.name !== class="st">"malignmark"
5198 ) {
5199 return false;
5200 }
5201 if (
5202 ac.namespace === NS_MATHML &&
5203 ac.tagName === class="st">"annotation-xml" &&
5204 t.name === class="st">"svg"
5205 ) {
5206 return false;
5207 }
5208 if (htmlIntegrationPoint(ac)) return false;
5209 return true;
5210 }
5211 if (t.type === TOKEN_CHAR) {
5212 if (mathmlTextIntegrationPoint(ac)) return false;
5213 if (htmlIntegrationPoint(ac)) return false;
5214 return true;
5215 }
5216 if (t.type === TOKEN_END_TAG) return true;
5217 if (t.type === TOKEN_COMMENT) return true;
5218 return false;
5219 };
5220
5221 const mathmlTextIntegrationPoint = (/** @type {HtmlElement} */ el) =>
5222 el.namespace === NS_MATHML && MATHML_TEXT_INTEGRATION.has(el.tagName);

Callers 1

processFunction · 0.85

Calls 2

htmlIntegrationPointFunction · 0.85

Tested by

no test coverage detected