From 90aaf2aed1084f2a895dd6bed2407651b38e1f07 Mon Sep 17 00:00:00 2001 From: Simran Brucherseifer Date: Mon, 18 Jul 2016 11:12:15 +0200 Subject: [PATCH] Match inline docublocks non-greedy and prevent name collisions by expecting a whitespace character after block name --- Documentation/Scripts/generateMdFiles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/Scripts/generateMdFiles.py b/Documentation/Scripts/generateMdFiles.py index 5fa241741b..3f3a160219 100644 --- a/Documentation/Scripts/generateMdFiles.py +++ b/Documentation/Scripts/generateMdFiles.py @@ -394,7 +394,7 @@ def walk_on_files(inDirPath, outDirPath): def findStartCode(fd,full_path): inFD = open(full_path, "r") - textFile =inFD.read() + textFile = inFD.read() inFD.close() #print "-" * 80 #print textFile @@ -453,7 +453,7 @@ def replaceTextInline(text, pathOfFile, searchText): print >> sys.stderr, '*' * 80 print >> sys.stderr, text exit(1) - rePattern = r'(?s)\s*@startDocuBlockInline\s+'+ searchText +'.*@endDocuBlock\s' + searchText + rePattern = r'(?s)\s*@startDocuBlockInline\s+'+ searchText +'\s.*?@endDocuBlock\s' + searchText # (?s) is equivalent to flags=re.DOTALL but works in Python 2.6 match = re.search(rePattern, text)