[gtk-doc] Don't eat newlines in section heading regex



commit c7b48fbc3f456cff8fe6162f10cf206047671b84
Author: William Jon McCann <william jon mccann gmail com>
Date:   Wed Jan 29 17:37:02 2014 -0500

    Don't eat newlines in section heading regex
    
    Use a lookbehind operator to match the newlines without stealing them.
    Fixes test in previous commit.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723288

 gtkdoc-mkdb.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index aa45ed6..14da873 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -4635,7 +4635,7 @@ sub ConvertMarkDownCallback {
     #          Header 2
     #          --------
     #
-    if($text =~ s%^\n(.+)[ \t]*\n=+[ \t]*\n\n%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
+    if($text =~ s%(?<=\n)(.+)[ \t]*\n=+[ \t]*\n\n%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
         $md_in_refsect2=1;
     }
 
@@ -4646,7 +4646,7 @@ sub ConvertMarkDownCallback {
     #        ...
     #        ###### Header 6
     #
-    if($text =~ s%^\n\#[ \t]*(.+?)[ \t]*\#\n+%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
+    if($text =~ s%(?<=\n)\#[ \t]*(.+?)[ \t]*\#\n+%$end_of_section<refsect2><title>$1</title><para>\n%gm) {
         $md_in_refsect2=1;
     }
 


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