MCPcopy
hub / github.com/prettier/prettier / printChild

Function printChild

src/language-html/print/children.js:45–72  ·  view source on GitHub ↗
(path, options, print)

Source from the content-addressed store, hash-verified

43}
44
45function printChild(path, options, print) {
46 const child = path.node;
47
48 if (hasPrettierIgnore(child)) {
49 const endLocation = getEndLocation(child);
50
51 return [
52 printOpeningTagPrefix(child, options),
53 replaceEndOfLine(
54 htmlWhitespace.trimEnd(
55 options.originalText.slice(
56 locStart(child) +
57 (child.prev && needsToBorrowNextOpeningTagStartMarker(child.prev)
58 ? printOpeningTagStartMarker(child).length
59 : 0),
60 endLocation -
61 (child.next && needsToBorrowPrevClosingTagEndMarker(child.next)
62 ? printClosingTagEndMarker(child, options).length
63 : 0),
64 ),
65 ),
66 ),
67 printClosingTagSuffix(child, options),
68 ];
69 }
70
71 return print();
72}
73
74function printBetweenLine(prevNode, nextNode) {
75 if (isTextLikeNode(prevNode) && isTextLikeNode(nextNode)) {

Callers 1

printChildrenFunction · 0.85

Calls 12

hasPrettierIgnoreFunction · 0.90
printOpeningTagPrefixFunction · 0.90
replaceEndOfLineFunction · 0.90
locStartFunction · 0.90
printClosingTagEndMarkerFunction · 0.90
printClosingTagSuffixFunction · 0.90
getEndLocationFunction · 0.85
trimEndMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…