[gtk-doc] rebase: fix on-line location extraction from devhelp files



commit b77d97bfe0186eb727604dbad565dc4dde0eb273
Author: Tim-Philipp Müller <tim centricular com>
Date:   Mon Mar 5 00:28:29 2018 +0000

    rebase: fix on-line location extraction from devhelp files
    
    Fix regex to match online location:
     - only require one space before online=..
     - don't require slash after online="https://..";
    
    Fix follow-up sub on match:
     - match.groups(1) returns a tuple, use match.group(1) to
       get a string back which is what we need to feed to re.sub()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794051

 gtkdoc/rebase.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc/rebase.py b/gtkdoc/rebase.py
index b329c51..75713ce 100755
--- a/gtkdoc/rebase.py
+++ b/gtkdoc/rebase.py
@@ -140,10 +140,10 @@ def ReadDevhelp(dir, file):
         # online must come before chapter/functions
         if '<chapters' in line or '<functions' in line:
             break
-        match = re.search(r'  online="([^"]*)"/', line)
+        match = re.search(r' online="([^"]*)"', line)
         if match:
             # Remove trailing non-directory component.
-            onlinedir = re.sub(r'(.*/).*', r'\1', match.groups(1))
+            onlinedir = re.sub(r'(.*/).*', r'\1', match.group(1))
     return onlinedir
 
 


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