From dc85729101b4429341f47d34baf5af5602c735ee Mon Sep 17 00:00:00 2001 From: Florian Knoch Date: Fri, 7 Feb 2020 22:25:05 +0100 Subject: [PATCH 1/2] Adapt to new fragment prefix --- test/slides/chapter1.de.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/slides/chapter1.de.md b/test/slides/chapter1.de.md index 3628747..4b1bf2c 100644 --- a/test/slides/chapter1.de.md +++ b/test/slides/chapter1.de.md @@ -6,11 +6,11 @@ Wirklich auf den Punkt! @slide @title -^in Wirklich auf den Punkt! +;in Wirklich auf den Punkt! @content -* ^in Stichpunkt 1 -* ^in Stichpunkt 2 -* ^in Stichpunkt 3 -* ^in Stichpunkt 4 +* ;in Stichpunkt 1 +* ;in Stichpunkt 2 +* ;in Stichpunkt 3 +* ;in Stichpunkt 4 From 47ffa62e83873ab7aaedaf64b8bdad86de05faea Mon Sep 17 00:00:00 2001 From: Florian Knoch Date: Sat, 8 Feb 2020 16:56:21 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Change=20fragment=20prefix=20to=20=C2=BB+?= =?UTF-8?q?=3F=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fragments.py | 5 ++--- test/slides/chapter1.de.md | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fragments.py b/fragments.py index aec298a..52257c8 100644 --- a/fragments.py +++ b/fragments.py @@ -4,8 +4,7 @@ import string from lxml import etree -FRAGMENT_PREFIX = "in" -FRAGMENT_TAG = ";%s" % FRAGMENT_PREFIX +FRAGMENT_TAG = "+?" FRAGMENT_CLASS = "fragment" # Search and delete the FRAGMENT_TAG anywhere in the given HTML @@ -23,7 +22,7 @@ def defragmentize(html): class_list += " %s" % FRAGMENT_CLASS fragment.set('class', class_list) - fragment.text = re.sub(r"\s*;%s\s*" % FRAGMENT_PREFIX, '', fragment.text).strip() + fragment.text = re.sub(r"\s*%s\s*" % re.escape(FRAGMENT_TAG), '', fragment.text).strip() return etree.tostring(dom, method='html', encoding='utf-8', pretty_print=True).decode('utf-8') diff --git a/test/slides/chapter1.de.md b/test/slides/chapter1.de.md index 4b1bf2c..a5d3a9e 100644 --- a/test/slides/chapter1.de.md +++ b/test/slides/chapter1.de.md @@ -6,11 +6,11 @@ Wirklich auf den Punkt! @slide @title -;in Wirklich auf den Punkt! ++? Wirklich auf den Punkt! @content -* ;in Stichpunkt 1 -* ;in Stichpunkt 2 -* ;in Stichpunkt 3 -* ;in Stichpunkt 4 +* +? Stichpunkt 1 +* +? Stichpunkt 2 +* +? Stichpunkt 3 +* +? Stichpunkt 4