@@ -713,6 +713,20 @@ function SearchRecord(ctx, navnode, node::Node, ::MarkdownAST.AbstractElement)
713713 return SearchRecord (ctx, navnode; text = mdflatten (node))
714714end
715715
716+ # Returns nothing for nodes that shouldn't be indexed in search
717+ const _SEARCHRECORD_IGNORED_BLOCK_TYPES = Union{
718+ Documenter. MetaNode,
719+ Documenter. DocsNodesBlock,
720+ Documenter. SetupNode,
721+ }
722+ function searchrecord (ctx:: HTMLContext , navnode:: Documenter.NavNode , node:: Node )
723+ # Skip indexing special at-blocks
724+ if node. element isa _SEARCHRECORD_IGNORED_BLOCK_TYPES
725+ return nothing
726+ end
727+ return SearchRecord (ctx, navnode, node, node. element)
728+ end
729+
716730function JSON. lower (rec:: SearchRecord )
717731 # Replace any backslashes in links, if building the docs on Windows
718732 src = replace (rec. src, ' \\ ' => ' /' )
@@ -1680,8 +1694,10 @@ end
16801694function domify (dctx:: DCtx )
16811695 ctx, navnode = dctx. ctx, dctx. navnode
16821696 return map (getpage (ctx, navnode). mdast. children) do node
1683- rec = SearchRecord (ctx, navnode, node, node. element)
1684- push! (ctx. search_index, rec)
1697+ rec = searchrecord (ctx, navnode, node)
1698+ if ! isnothing (rec)
1699+ push! (ctx. search_index, rec)
1700+ end
16851701 domify (dctx, node, node. element)
16861702 end
16871703end
0 commit comments