diff --git a/src/html/HTMLWriter.jl b/src/html/HTMLWriter.jl
index 7aff57f21b..e03980648c 100644
--- a/src/html/HTMLWriter.jl
+++ b/src/html/HTMLWriter.jl
@@ -2514,7 +2514,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 = strip(mdflatten(node))
content_hash = string(hash(node_repr), base = 16)
admonition_id = if !isempty(a.title)
base_id = Documenter.slugify(a.title)