From 35b193b453a046e5a5dfb0acf982699153966551 Mon Sep 17 00:00:00 2001 From: dberzano Date: Thu, 11 Dec 2014 12:23:43 +0100 Subject: [PATCH] doxy: convert
 to Markdown ~~~

Doxygen understands 
 correctly (as it supports HTML), but code
blocks rendered with ~~~ are rendered with a different style.
---
 doxygen/thtml2doxy.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/doxygen/thtml2doxy.py b/doxygen/thtml2doxy.py
index f9fba5315ad..849db849340 100755
--- a/doxygen/thtml2doxy.py
+++ b/doxygen/thtml2doxy.py
@@ -476,6 +476,9 @@ def refactor_comment(comment, do_strip_html=True):
   # Support for LaTeX blocks on a single line
   reinline_latex = r'(?i)(.*)BEGIN_LATEX\s+(.*?)\s+END_LATEX(.*)$'
 
+  # Match 
 (to turn it into the ~~~ Markdown syntax)
+  reblock = r'(?i)^(\s*)\s*$'
+
   new_comment = []
   insert_blank = False
   wait_first_non_blank = True
@@ -568,6 +571,15 @@ def refactor_comment(comment, do_strip_html=True):
           # Prevent appending lines (we have already done that)
           new_line_comment = None
 
+        # If we are not in a LaTeX block, look for 
 tags and transform them into Doxygen code
+        # blocks (using ~~~ ... ~~~). Only 
 tags on a single line are supported
+        if new_line_comment is not None and not in_latex:
+
+          mblock = re.search( reblock, new_line_comment  )
+          if mblock:
+            new_comment.append( mblock.group(1)+'~~~' )
+            new_line_comment = None
+
         if new_line_comment is not None:
           if in_latex:
             new_line_comment = new_line_comment.replace('#', '\\')
-- 
2.39.3