| 9120e874 Andy McCall |
1 |
const { marked } = require('marked'); |
| 2 |
const renderer = new marked.Renderer(); |
| 3 |
|
| 4 |
|
| 5 |
renderer.link = (href, title, text) => { |
| 6 |
|
| 7 |
const myURL = new URL(href, "http://localhost/"); |
| 8 |
if (myURL.hostname == "localhost") { |
| 9 |
href = myURL.hash; |
| 10 |
} |
| 11 |
|
| 12 |
return ` |
| 13 |
<a href="${href}"> |
| 14 |
${text} |
| 15 |
</a> |
| 16 |
` |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
module.exports = { |
| 21 |
marked_options: { renderer }, |
| 22 |
}; |