From be9f62ad5b8633a8778d9be8048efcd3ccf64211 Mon Sep 17 00:00:00 2001 From: "Dennis.Glaeser" <dennis.glaeser@iws.uni-stuttgart.de> Date: Sat, 28 Mar 2020 12:28:21 +0100 Subject: [PATCH] [docgen][code_to_md] avoid newline at beginning/end of code blocks --- examples/convert_code_to_doc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/convert_code_to_doc.py b/examples/convert_code_to_doc.py index 69305d8de9..80db041164 100755 --- a/examples/convert_code_to_doc.py +++ b/examples/convert_code_to_doc.py @@ -14,8 +14,8 @@ def parseTaggedContent(keyname, action, open="[[", close="]]", endTag="/"): """ Match content between [[keyname]] and [[/keyname]] and apply the action on it """ - start = LineStart() + ZeroOrMore(" ") + "//" + ZeroOrMore(" ") + Literal(open + str(keyname) + close) - end = LineStart() + ZeroOrMore(" ") + "//" + ZeroOrMore(" ") + Literal(open + endTag + str(keyname) + close) + start = LineStart() + ZeroOrMore(" ") + "//" + ZeroOrMore(" ") + Literal(open + str(keyname) + close) + LineEnd() + end = LineStart() + ZeroOrMore(" ") + "//" + ZeroOrMore(" ") + Literal(open + endTag + str(keyname) + close) + LineEnd() return start.suppress() + SkipTo(end).setParseAction(action) + end.suppress() def createMarkdownCode(markDownToken): -- GitLab