The search result from Sphinx displays raw ReST file snippets showing
the context of the search hit. While we could generate text versions of
the ReST files just for the search results, it would potentially double
the time to generate docs (run once to generate txt files, run again to
generate HTML).
Instead, this patch does a poor man's cleanup of the ReST markup on the
fly when the search summary snippets are written out. Not perfect, but
looks much better.
It does expose a problem that some of our ReST content is not actually
written out into a .rst file. Content that's dynamically generated by
extensions, such as the sample code from zephyr-app-commands, can
yield a search result hit, but there's no hits in the .rst file content
itself.
Line 552-558 are the modified lines from the Sphinx-provided
searchtools.js that does the pattern match/replace.
Addresses: #7032
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>