671 """ |
671 """ |
672 try: |
672 try: |
673 import markdown # __IGNORE_EXCEPTION__ |
673 import markdown # __IGNORE_EXCEPTION__ |
674 except ImportError: |
674 except ImportError: |
675 return self.tr( |
675 return self.tr( |
676 """<p>Markdown preview requires the <b>python-markdown</b> """ |
676 """<p>Markdown preview requires the <b>Markdown</b> """ |
677 """package.<br/>Install it with your package manager,""" |
677 """package.<br/>Install it with your package manager,""" |
678 """ 'pip install docutils' or see """ |
678 """ 'pip install Markdown' or see """ |
679 """<a href="http://pythonhosted.org/Markdown/install.html">""" |
679 """<a href="http://pythonhosted.org/Markdown/install.html">""" |
680 """installation instructions.</a></p>""") |
680 """installation instructions.</a></p>""") |
681 |
681 |
682 try: |
682 try: |
683 import mdx_mathjax # __IGNORE_EXCEPTION__ __IGNORE_WARNING__ |
683 import mdx_mathjax # __IGNORE_EXCEPTION__ __IGNORE_WARNING__ |
698 class _StrikeThroughExtension(markdown.Extension): |
698 class _StrikeThroughExtension(markdown.Extension): |
699 """ |
699 """ |
700 Class is placed here, because it depends on imported markdown, |
700 Class is placed here, because it depends on imported markdown, |
701 and markdown import is lazy. |
701 and markdown import is lazy. |
702 |
702 |
703 (see http://achinghead.com/ |
703 (see https://pythonhosted.org/Markdown/extensions/api.html |
704 python-markdown-adding-insert-delete.html this page for |
704 this page for details) |
705 details) |
|
706 """ |
705 """ |
707 DEL_RE = r'(~~)(.*?)~~' |
706 DEL_RE = r'(~~)(.*?)~~' |
708 |
707 |
709 def extendMarkdown(self, md, md_globals): |
708 def extendMarkdown(self, md, md_globals): |
710 # Create the del pattern |
709 # Create the del pattern |