MCPcopy
hub / github.com/prettier/prettier / isEmbedHtml

Function isEmbedHtml

src/language-js/embed/html.js:109–121  ·  view source on GitHub ↗

* - html`...` * - HTML comment block

(path)

Source from the content-addressed store, hash-verified

107 * - HTML comment block
108 */
109function isEmbedHtml(path) {
110 return (
111 hasLanguageComment(path, "HTML") ||
112 path.match(
113 (node) => node.type === "TemplateLiteral",
114 (node, name) =>
115 node.type === "TaggedTemplateExpression" &&
116 node.tag.type === "Identifier" &&
117 node.tag.name === "html" &&
118 name === "quasi",
119 )
120 );
121}
122
123const printEmbedHtml = printEmbedHtmlLike.bind(undefined, "html");
124const printEmbedAngular = printEmbedHtmlLike.bind(undefined, "angular");

Callers

nothing calls this directly

Calls 2

hasLanguageCommentFunction · 0.90
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…