Skip to content

Commit

Permalink
Fix #1201
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Apr 4, 2014
1 parent 728da57 commit 679ebba
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Features
Bugfixes
--------

* Make markdown extensions not break when markdown is not installed (Issue #1201)
* hidetitle now works in posts, too (Issue #1188)
* Refactoring of post translation checking (Issue #1194)
* Trigger rebuild on gallery changes in auto mode (Issue #1180)
Expand Down
15 changes: 11 additions & 4 deletions nikola/plugins/compile/markdown/mdx_gist.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,18 @@
'''
from __future__ import unicode_literals, print_function
from markdown.extensions import Extension

try:
from markdown.extensions import Extension
from markdown.inlinepatterns import Pattern
from markdown.util import AtomicString
from markdown.util import etree
except ImportError:
# No need to catch this, if you try to use this without Markdown,
# the markdown compiler will fail first
Extension = Pattern = object

from nikola.plugin_categories import MarkdownExtension
from markdown.inlinepatterns import Pattern
from markdown.util import AtomicString
from markdown.util import etree
from nikola.utils import get_logger, req_missing, STDERR_HANDLER

LOGGER = get_logger('compile_markdown.mdx_gist', STDERR_HANDLER)
Expand Down
10 changes: 8 additions & 2 deletions nikola/plugins/compile/markdown/mdx_nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@
"""Markdown Extension for Nikola-specific post-processing"""
from __future__ import unicode_literals
import re
from markdown.postprocessors import Postprocessor
try:
from markdown.postprocessors import Postprocessor
from markdown.extensions import Extension
except ImportError:
# No need to catch this, if you try to use this without Markdown,
# the markdown compiler will fail first
Postprocessor = Extension = object

from nikola.plugin_categories import MarkdownExtension
from markdown.extensions import Extension


class NikolaPostProcessor(Postprocessor):
Expand Down
11 changes: 8 additions & 3 deletions nikola/plugins/compile/markdown/mdx_podcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@
'''

from nikola.plugin_categories import MarkdownExtension
from markdown.extensions import Extension
from markdown.inlinepatterns import Pattern
from markdown.util import etree
try:
from markdown.extensions import Extension
from markdown.inlinepatterns import Pattern
from markdown.util import etree
except ImportError:
# No need to catch this, if you try to use this without Markdown,
# the markdown compiler will fail first
Pattern = Extension = object

PODCAST_RE = r'\[podcast\](?P<url>.+)\[/podcast\]'

Expand Down

0 comments on commit 679ebba

Please sign in to comment.