Commit 86d937c9 authored by Denis Salem's avatar Denis Salem
Browse files

Add Escape patterns

parent 043c3168
......@@ -141,8 +141,9 @@
DONE | Add support for Atom feed.
DONE | Add blog generation timestamp.
DONE | Split unit-test from main branch
DONE | Support ForPage in entries thread.
TODO | Blacklist user defined patterns from entry.
DONE | Support ForPage in entries thread.
DONE | Escape patterns
TODO | Sort by metadata.
TODO | Update command help with.
TODO | Open with navigator manual.
TODO | Client-side search engine.
......
......@@ -159,6 +159,7 @@ def export_blog(argv=list()):
# Blacklist contextual patterns
for pattern_name in contextual_pattern_names.keys():
processor.blacklist.append(pattern_name)
processor.blacklist.append("Escape")
notify(messages.pre_process)
......
......@@ -289,6 +289,7 @@ class Processor():
to_remove = list()
for index in pre_processed.patterns_index:
current_pattern = pre_processed.sub_strings[index][2:-2].split('::')[0]
if current_pattern in ["CodeHighlight", "Latex2MathML", "IncludeFile", "audio", "video","EmbedContent"]:
pre_processed.keep_appart_from_markup_index.append((index,True))
......@@ -304,6 +305,11 @@ class Processor():
)
if (not current_pattern in self.blacklist) and (not current_pattern in self.forbidden) :
if current_pattern == "Escape":
pre_processed.sub_strings[index] = ''.join(pre_processed.sub_strings[index][2:-2].split('::')[1:])
to_remove.append(index)
continue
pre_processed.sub_strings[index] = self.process(pre_processed.sub_strings[index], escape)
# check if there is residual patterns
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment