From 03174698e0b56eb5c967370261ec17547d13b9e8 Mon Sep 17 00:00:00 2001 From: holamgadol Date: Wed, 13 Dec 2023 12:23:09 +0300 Subject: [PATCH] Revert "fix: frontmatter_pattern and tests (#5)" (#6) This reverts commit a842f12d1ee77784d084b401f04c20a0aef3110e. --- foliant/preprocessors/escapecode.py | 2 +- tests/data/expected/frontmatter_yaml.md | 6 ------ tests/data/input/frontmatter_yaml.md | 10 ---------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/foliant/preprocessors/escapecode.py b/foliant/preprocessors/escapecode.py index 088882b..e5e6875 100644 --- a/foliant/preprocessors/escapecode.py +++ b/foliant/preprocessors/escapecode.py @@ -39,7 +39,7 @@ def __init__(self, *args, **kwargs): self.content = None self.pre_blocks_pattern = None self._cache_dir_path = (self.project_path / self.options['cache_dir']).resolve() - self.frontmatter_pattern = re.compile(r'^((-|\+){3})\n([\s\S]+?)\n((-|\+){3})([\s\S]*)') + self.frontmatter_pattern = re.compile(r'^((-|\+){3})\n([\s\S]*)\n((-|\+){3})([\s\S]*)') self.logger = self.logger.getChild('escapecode') diff --git a/tests/data/expected/frontmatter_yaml.md b/tests/data/expected/frontmatter_yaml.md index 29586ce..4cf3169 100644 --- a/tests/data/expected/frontmatter_yaml.md +++ b/tests/data/expected/frontmatter_yaml.md @@ -4,12 +4,6 @@ # Test - - ---- - - - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo diff --git a/tests/data/input/frontmatter_yaml.md b/tests/data/input/frontmatter_yaml.md index e1d4385..1120396 100644 --- a/tests/data/input/frontmatter_yaml.md +++ b/tests/data/input/frontmatter_yaml.md @@ -6,16 +6,6 @@ tempor incididunt ut labore." # Test -```py -import re -``` - ---- - -```py -import os -``` - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo