Created
September 10, 2020 17:37
-
-
Save sayjeyhi/267c7cacb6b4e881155062451a66afb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get table of contents and apply answer link on them | |
html = html.replace( | |
/<td><a \S+=["']?#((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?.*>(.*)<\/a><\/td>/gm, | |
(whole, p1, p2) => | |
`<td id="${makeUrl(p2)}-q"><a class="fehrest" href="#${makeUrl( | |
p2 | |
)}">${p2}</a></td>` | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment