diff options
author | albert-github <albert.tests@gmail.com> | 2020-11-25 10:59:50 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-11-25 10:59:50 (GMT) |
commit | 3655a0164951b5bce015196381267d2b878ab901 (patch) | |
tree | fe2541e93fbabecf8193a41ba7845c44f3dc75d0 /src | |
parent | 6de91dc5e32e6d97a557fe6910a6cbf1d453ad9c (diff) | |
download | Doxygen-3655a0164951b5bce015196381267d2b878ab901.zip Doxygen-3655a0164951b5bce015196381267d2b878ab901.tar.gz Doxygen-3655a0164951b5bce015196381267d2b878ab901.tar.bz2 |
Default doxygen search mechanism doesn't work when using with XHTML output
The problem has been tested with the doxygen test 021. With the output format html all works OK.
- When giving a `t` in the search window a window appears with the message "This XML file does not appear to have any style information associated with it. The document tree is shown below."
- the `<html> statement has to replaced by `<html xmlns="http://www.w3.org/1999/xhtml">` in searchindex.cpp (is normally also present in the non search xhtml files).
- this results in a window with just the words:
Loading....
Searching...
No Matches
- this is due to the extra `<!--` / `-->` in the htmlsearchresults.tpl (strange enough html output has no problem with it).
- When giving a `a` in the search windows we get a "File not found" message as the file nomatches.html cannot be found
- the extension for "nomatches" has to be set properly as well (search.js), for the other files this is done a few lines upward.
Diffstat (limited to 'src')
-rw-r--r-- | src/searchindex.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp index b0f6abb..0464cb4 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -923,7 +923,8 @@ void writeJavaScriptSearchIndex() t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" " \"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl; - t << "<html><head><title></title>" << endl; + t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl; + t << "<head><title></title>" << endl; t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl; t << "<meta name=\"generator\" content=\"Doxygen " << getDoxygenVersion() << "\"/>" << endl; t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl; @@ -934,18 +935,18 @@ void writeJavaScriptSearchIndex() t << "<div id=\"SRIndex\">" << endl; t << "<div class=\"SRStatus\" id=\"Loading\">" << theTranslator->trLoading() << "</div>" << endl; t << "<div id=\"SRResults\"></div>" << endl; // here the results will be inserted - t << "<script type=\"text/javascript\"><!--" << endl; - t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "<script type=\"text/javascript\">" << endl; + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; t << "createResults();" << endl; // this function will insert the results - t << "/* @license-end */\n"; - t << "--></script>" << endl; + t << "/* @license-end */\n"; + t << "</script>" << endl; t << "<div class=\"SRStatus\" id=\"Searching\">" << theTranslator->trSearching() << "</div>" << endl; t << "<div class=\"SRStatus\" id=\"NoMatches\">" << theTranslator->trNoMatches() << "</div>" << endl; - t << "<script type=\"text/javascript\"><!--" << endl; - t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "<script type=\"text/javascript\">" << endl; + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; t << "document.getElementById(\"Loading\").style.display=\"none\";" << endl; t << "document.getElementById(\"NoMatches\").style.display=\"none\";" << endl; t << "var searchResults = new SearchResults(\"searchResults\");" << endl; @@ -956,8 +957,8 @@ void writeJavaScriptSearchIndex() t << " if (elem) elem.focus();" << endl; t << " }" << endl; t << "});" << endl; - t << "/* @license-end */\n"; - t << "--></script>" << endl; + t << "/* @license-end */\n"; + t << "</script>" << endl; t << "</div>" << endl; // SRIndex t << "</body>" << endl; t << "</html>" << endl; @@ -1229,7 +1230,8 @@ void writeJavaScriptSearchIndex() FTextStream t(&f); t << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " "\"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" << endl; - t << "<html><head><title></title>" << endl; + t << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl; + t << "<head><title></title>" << endl; t << "<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>" << endl; t << "<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>" << endl; t << "<script type=\"text/javascript\" src=\"search.js\"></script>" << endl; |