[gtk-doc] Don't escape blockquote markup in non-sgml mode



commit b53854db16f6767f55382fd4ca7e45d76d092ea2
Author: William Jon McCann <william jon mccann gmail com>
Date:   Mon Mar 17 16:45:26 2014 -0400

    Don't escape blockquote markup in non-sgml mode
    
    Escaping > etc unconditionally breaks markdown in non-sgml mode.
    We should do the escaping the same in both modes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726580

 gtkdoc-mkdb.in |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 6e3db0d..7a27f3e 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -2765,9 +2765,13 @@ sub ConvertSGMLChars {
                                    \&ConvertSGMLCharsCallback);
     } else {
         # For the simple non-sgml mode, convert to entities everywhere.
-        $text =~ s/&/&amp;/g;        # Do this first, or the others get messed up.
+
+       # First, convert freestanding & to &amp;
+        $text =~ s/&(?![a-zA-Z#]+;)/&amp;/g;
         $text =~ s/</&lt;/g;
-        $text =~ s/>/&gt;/g;
+        # Allow ">" at beginning of string for blockquote markdown
+        $text =~ s/(?<=[^\w\n"'\/-])>/&gt;/g;
+
         return $text;
     }
 }
@@ -4943,7 +4947,6 @@ sub MarkDownParseBlocks {
     }
 
     # indentation insensitive types
-
     if ($line =~ /^[ ]*<!DOCTYPE/) {
       push @md_blocks, $md_block;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]