No need to use regexp to compare equality
This commit is contained in:
parent
201a20e1c3
commit
e7db190fca
@ -51,7 +51,6 @@ from __future__ import absolute_import
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from markdown import Extension
|
from markdown import Extension
|
||||||
from markdown.preprocessors import Preprocessor
|
from markdown.preprocessors import Preprocessor
|
||||||
import re
|
|
||||||
import yaml
|
import yaml
|
||||||
try:
|
try:
|
||||||
from yaml import CSafeLoader as Loader
|
from yaml import CSafeLoader as Loader
|
||||||
@ -87,10 +86,10 @@ class MetaYamlPreprocessor(Preprocessor):
|
|||||||
""" Parse Meta-Data and store in Markdown.Meta. """
|
""" Parse Meta-Data and store in Markdown.Meta. """
|
||||||
yaml_block = []
|
yaml_block = []
|
||||||
line = lines.pop(0)
|
line = lines.pop(0)
|
||||||
if re.match(r'-{3}', line):
|
if line == "---":
|
||||||
while lines:
|
while lines:
|
||||||
line = lines.pop(0)
|
line = lines.pop(0)
|
||||||
if re.match(r'(\.{3}|-{3})', line):
|
if line in ("---", "..."):
|
||||||
break
|
break
|
||||||
yaml_block.append(line)
|
yaml_block.append(line)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user