Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes compatibility with Python 2.6 #76

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/landslide/generator.py
Expand Up @@ -341,11 +341,11 @@ def get_slide_vars(self, slide_src, source=None):
if content:
content, slide_classes = self.process_macros(content, source)

find = re.search(r'<h\d[^>]*>presenter notes</h\d>', content,
find = re.search(r'<h1>notes</h1>(.*)', content,
re.DOTALL | re.UNICODE | re.IGNORECASE)

if find:
presenter_notes = content[find.end():].strip()
presenter_notes = find.group(1)
content = content[:find.start()]

source_dict = {}
Expand Down
6 changes: 5 additions & 1 deletion src/landslide/parser.py
Expand Up @@ -77,7 +77,11 @@ def parse(self, text):
html = html_body(text, input_encoding=self.encoding)
# RST generates pretty much markup to be removed in our case
for (pattern, replacement, mode) in self.RST_REPLACEMENTS:
html = re.sub(pattern, replacement, html, 0, mode)
try:
html = re.sub(pattern, replacement, html, 0, mode)
except TypeError:
html = re.sub(pattern, replacement, html, 0)

return html.strip()
elif self.format == 'textile':
try:
Expand Down