(token)
| 75 | |
| 76 | const seenIDs = Object.create(null) |
| 77 | function anchor(token) { |
| 78 | let id = token.hashID |
| 79 | if (id in seenIDs) for (let i = 1;; i++) { |
| 80 | let ext = id + "_" + i |
| 81 | if (!(ext in seenIDs)) { id = ext; break } |
| 82 | } |
| 83 | seenIDs[id] = true |
| 84 | return `<a class="${id.charAt(0)}_ident" id="${id}" href="#${id}" tabindex="-1" role="presentation"></a>` |
| 85 | } |
| 86 | |
| 87 | function attrs(token) { |
| 88 | return token.attrs ? token.attrs.map(([name, val]) => ` ${name}="${escape(String(val))}"`).join("") : "" |
no outgoing calls
no test coverage detected