Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/html/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,12 @@ function domify(dctx::DCtx, node::Node, f::MarkdownAST.FootnoteDefinition)
return DOM.Node[]
end

# This function provided by Michael Goerz in https://github.com/JuliaDocs/MarkdownAST.jl/issues/18
function _markdownast_to_str(node::MarkdownAST.Node)
text = Documenter.MDFlatten.mdflatten(node)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has using ...MDFlatten: mdflatten so you can write

Suggested change
text = Documenter.MDFlatten.mdflatten(node)
text = mdflatten(node)

but at that point I wonder: why even bother with this helper?

return strip(text)
end

function domify(dctx::DCtx, node::Node, a::MarkdownAST.Admonition)
@tags header div details summary
colorclass =
Expand Down Expand Up @@ -2514,7 +2520,7 @@ function domify(dctx::DCtx, node::Node, a::MarkdownAST.Admonition)
# apply a class
isempty(cat_sanitized) ? "" : ".is-category-$(cat_sanitized)"
end
node_repr = sprint(io -> show(io, node))
node_repr = _markdownast_to_str(node)
content_hash = string(hash(node_repr), base = 16)
admonition_id = if !isempty(a.title)
base_id = Documenter.slugify(a.title)
Expand Down
Loading