chiark / gitweb /
doxygen: strip HTML tags from function param types in search.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 28 Jan 2018 21:30:18 +0000 (22:30 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 3 Feb 2018 09:51:55 +0000 (10:51 +0100)
doxygen/dox2html5.py
doxygen/test/search/Dir/File.h
doxygen/test/test_search.py

index 522bcab688d0e941220b13b66a22219c922ae356..64ef448a746b17d89937a0021cba44058cbe1d63 100755 (executable)
@@ -1563,14 +1563,19 @@ def build_search_data(state: State) -> bytearray:
 
     # TODO: examples?
 
+    strip_tags_re = re.compile('<.*?>')
+    def strip_tags(text):
+        return strip_tags_re.sub('', text)
+
     for result in state.search:
         name_with_args = result.name
         name = result.name
         suffix_length = 0
         if hasattr(result, 'params') and result.params is not None:
-            name_with_args += '(' + ', '.join(result.params) + ')'
+            params = strip_tags(', '.join(result.params))
+            name_with_args += '(' + params + ')'
             name += '()'
-            suffix_length += len(', '.join(result.params))
+            suffix_length += len(html.unescape(params))
         if hasattr(result, 'suffix') and result.suffix:
             name_with_args += result.suffix
             # TODO: escape elsewhere so i don't have to unescape here
index 967cc66678334111eba9e270c07e7b0440b9a2e1..72819d5ba76f4091d914467cdcd211048b31a2da 100644 (file)
@@ -20,7 +20,7 @@ class Class {
         void foo() &&; /**< @overload */
 
         /** @brief Function with arguments */
-        void foo(with, arguments);
+        void foo(const Enum&, Typedef);
 };
 
 /** @brief A variable */
index 9029b1a933ff80aaa87b0acb3cdaa64df7e89af1..1e1251a47f9134edc625f9969428a0704470fe9e 100755 (executable)
@@ -339,7 +339,7 @@ macro [14]
 6: Namespace::Class::foo() [0] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9
 7: Namespace::Class::foo() const [1, suffix_length=6] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a
 8: Namespace::Class::foo() && [1, suffix_length=3] -> classNamespace_1_1Class.html#ac9e7e80d06281e30cfcc13171d117ade
-9: Namespace::Class::foo(with, arguments) [1, suffix_length=15] -> classNamespace_1_1Class.html#ac03e8437172963981197eb393e0550d3
+9: Namespace::Class::foo(const Enum&, Typedef) [1, suffix_length=20] -> classNamespace_1_1Class.html#abd560769b0863ca5d64905e8e0fc231b
 10: Namespace::Enum::Value [0] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfeaa689202409e48743b914713f96d93947c
 11: Namespace::Enum [0] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfea
 12: Namespace::Typedef [0] -> namespaceNamespace.html#abe2a245304bc2234927ef33175646e08