Add line numbers to file paths in the website editor structure docs (#3130)

* added the line number to existing path

* Update JS parser to use line numbers

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Mohd Mohsin
2026-02-16 05:29:27 +05:30
committed by GitHub
parent 82f7dc7062
commit b697cc8131
7 changed files with 51 additions and 14 deletions

View File

@@ -50,7 +50,7 @@ function buildHtmlList(nodes: Entry[], currentIndex: number, currentLevel: numbe
const hasDirectChildren = i + 1 < nodes.length && nodes[i + 1].level > node.level;
const hasDeeperChildren = hasDirectChildren && i + 2 < nodes.length && nodes[i + 2].level > nodes[i + 1].level;
const linkHtml = node.link ? `<a href="${node.link}" target="_blank">${path.basename(node.link)}</a>` : "";
const linkHtml = node.link ? `<a href="${node.link}" target="_blank">${path.basename(node.link.split("#L").join(":"))}</a>` : "";
const fieldPieces = node.text.match(/([^:]*):(.*)/);
let escapedText;
if (fieldPieces && fieldPieces.length === 3) {