MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / link_open

Function link_open

src/render_latex.mjs:180–186  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

178 meta_keyname_close() { return "}" },
179
180 link_open(token) {
181 let href= token.attrGet("href")
182 let maybeChapter = /^(\w+)(?:#(.*))?$/.exec(href)
183 if (!maybeChapter || !chapters.includes(maybeChapter[1])) return `\\href{${href}}{`
184 linkedChapter = chapters.indexOf(maybeChapter[1])
185 return `\\hyperref[${maybeChapter[1] + (maybeChapter[2] ? "." + maybeChapter[2] : "")}]{`
186 },
187 link_close() { linkedChapter = null; return "}" },
188
189 inline(token) { return renderArray(token.children) },

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected