Rework wikilinks feature
This commit is contained in:
@@ -19,12 +19,12 @@ import (
|
||||
|
||||
var md goldmark.Markdown
|
||||
|
||||
// initMarkdown builds the package-level goldmark instance. Called once from
|
||||
// main after the wiki root is known so the wiki-link extension can resolve
|
||||
// targets against the filesystem.
|
||||
func initMarkdown(root string) {
|
||||
// initMarkdown builds the package-level goldmark instance. Neither extension
|
||||
// resolves anything against the filesystem — wiki links are search queries and
|
||||
// embed destinations are relative to the page — so this needs no wiki root.
|
||||
func initMarkdown() {
|
||||
md = goldmark.New(
|
||||
goldmark.WithExtensions(extension.GFM, extension.Table, newWikiLinkExt(root), newWikiEmbedExt(root)),
|
||||
goldmark.WithExtensions(extension.GFM, extension.Table, newWikiLinkExt(), newEmbedExt()),
|
||||
goldmark.WithParserOptions(parser.WithAutoHeadingID()),
|
||||
goldmark.WithRendererOptions(html.WithUnsafe(), html.WithHardWraps()),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user