MCPcopy Create free account
hub / github.com/api-platform/website / onVisitLine

Function onVisitLine

pwa/next.config.mjs:107–113  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

105 // Callback hooks to add custom logic to nodes when visiting
106 // them.
107 onVisitLine(node) {
108 // Prevent lines from collapsing in `display: grid` mode, and
109 // allow empty lines to be copy/pasted
110 if (node.children.length === 0) {
111 node.children = [{ type: "text", value: " " }];
112 }
113 },
114 onVisitHighlightedLine(node) {
115 // Each line node by default has `class="line"`.
116 node.properties.className.push("highlighted");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected