@@ -713,6 +713,20 @@ function SearchRecord(ctx, navnode, node::Node, ::MarkdownAST.AbstractElement)
713
713
return SearchRecord (ctx, navnode; text = mdflatten (node))
714
714
end
715
715
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
+
716
730
function JSON. lower (rec:: SearchRecord )
717
731
# Replace any backslashes in links, if building the docs on Windows
718
732
src = replace (rec. src, ' \\ ' => ' /' )
@@ -1680,8 +1694,10 @@ end
1680
1694
function domify (dctx:: DCtx )
1681
1695
ctx, navnode = dctx. ctx, dctx. navnode
1682
1696
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
1685
1701
domify (dctx, node, node. element)
1686
1702
end
1687
1703
end
0 commit comments