From: dberzano Date: Tue, 9 Dec 2014 14:18:55 +0000 (+0100) Subject: doxy: strip some HTML tags X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=e4491652730e1bdb619cd21c684118d5592a486e doxy: strip some HTML tags --- diff --git a/doxygen/thtml2doxy_clang.py b/doxygen/thtml2doxy_clang.py index e1c5844abde..0a320417e08 100755 --- a/doxygen/thtml2doxy_clang.py +++ b/doxygen/thtml2doxy_clang.py @@ -294,7 +294,7 @@ def comment_classdesc(filename, comments): class_name_doxy = None reauthor = r'(?i)\\?authors?:?\s*(.*?)\s*(,?\s*([0-9./-]+))?\s*$' - redate = r'(?i)\\?date:?\s*([0-9./-]+)\s*$' + redate = r'(?i)\\?date:?\s*([0-9./-]+)' author = None date = None @@ -438,10 +438,18 @@ def traverse_ast(cursor, filename, comments, recursion=0): comment_classdesc(filename, comments) +## Strip some HTML tags from the given string. Returns clean string. +# +# @param s Input string +def strip_html(s): + rehtml = r'(?i)' + return re.sub(rehtml, '', s) + + ## Remove garbage from comments and convert special tags from THtml to Doxygen. # # @param comment An array containing the lines of the original comment -def refactor_comment(comment): +def refactor_comment(comment, do_strip_html=True): recomm = r'^(/{2,}|/\*)?\s*(.*?)\s*((/{2,})?\s*|\*/)$' regarbage = r'^(?i)\s*([\s*=-_#]+|(Begin|End)_Html)\s*$' @@ -450,6 +458,11 @@ def refactor_comment(comment): insert_blank = False wait_first_non_blank = True for line_comment in comment: + + # Strip some HTML tags + if do_strip_html: + line_comment = strip_html(line_comment) + mcomm = re.search( recomm, line_comment ) if mcomm: new_line_comment = mcomm.group(2)