diff options
Diffstat (limited to 'codegen/docextract_to_xml.py')
-rwxr-xr-x | codegen/docextract_to_xml.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/codegen/docextract_to_xml.py b/codegen/docextract_to_xml.py index 638ac94..0e6daa1 100755 --- a/codegen/docextract_to_xml.py +++ b/codegen/docextract_to_xml.py @@ -20,6 +20,11 @@ def usage(): '[-i | --with-signals ]\n') sys.exit(1) +# Translates special texts to &... HTML acceptable format. Also replace +# occurrences of '/*' and '*/' with '/ *' and '* /' respectively to avoid +# comment errors (note the spaces). Some function descriptions include C++ +# multi-line comments which cause errors when the description is included in a +# C++ Doxygen comment block. def escape_text(unescaped_text): # Escape every "&" not part of an entity reference escaped_text = re.sub(r'&(?![A-Za-z]+;)', '&', unescaped_text) @@ -35,6 +40,10 @@ def escape_text(unescaped_text): escaped_text = string.replace(escaped_text, '>', '>') escaped_text = string.replace(escaped_text, '"', '"') + # Replace C++ comment begin and ends to ones that don't affect Doxygen. + escaped_text = string.replace(escaped_text, '/*', '/ *') + escaped_text = string.replace(escaped_text, '*/', '* /') + return escaped_text def print_annotations(annotations): |