summaryrefslogtreecommitdiff
path: root/creole/creole2html/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'creole/creole2html/parser.py')
-rw-r--r--creole/creole2html/parser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/creole/creole2html/parser.py b/creole/creole2html/parser.py
index a8157e6..3cf263f 100644
--- a/creole/creole2html/parser.py
+++ b/creole/creole2html/parser.py
@@ -59,12 +59,14 @@ class CreoleParser:
inline_re = re.compile('|'.join(INLINE_RULES), INLINE_FLAGS)
- def __init__(self, raw, block_rules=BlockRules, blog_line_breaks=True):
+ def __init__(self, raw, block_rules=None, blog_line_breaks=True):
assert isinstance(raw, TEXT_TYPE)
self.raw = raw
+ if block_rules is None:
+ block_rules = BlockRules(blog_line_breaks=blog_line_breaks)
+
# setup block element rules:
- block_rules = block_rules(blog_line_breaks=blog_line_breaks)
self.block_re = re.compile('|'.join(block_rules.rules), block_rules.re_flags)
self.blog_line_breaks = blog_line_breaks