227 if extension in \ |
227 if extension in \ |
228 Preferences.getEditor("PreviewHtmlFileNameExtensions") or \ |
228 Preferences.getEditor("PreviewHtmlFileNameExtensions") or \ |
229 editor.getLanguage() == "HTML": |
229 editor.getLanguage() == "HTML": |
230 language = "HTML" |
230 language = "HTML" |
231 elif extension in \ |
231 elif extension in \ |
232 Preferences.getEditor("PreviewMarkdownFileNameExtensions"): |
232 Preferences.getEditor("PreviewMarkdownFileNameExtensions"): |
233 language = "Markdown" |
233 language = "Markdown" |
234 elif extension in \ |
234 elif extension in \ |
235 Preferences.getEditor("PreviewRestFileNameExtensions"): |
235 Preferences.getEditor("PreviewRestFileNameExtensions"): |
236 language = "ReST" |
236 language = "ReST" |
237 else: |
237 else: |
238 self.__setHtml(fn, self.trUtf8( |
238 self.__setHtml(fn, self.trUtf8( |
239 "<p>No preview available for this type of file.</p>")) |
239 "<p>No preview available for this type of file.</p>")) |
240 return |
240 return |
511 |
511 |
512 extensions = ['fenced_code', 'nl2br', 'extra'] |
512 extensions = ['fenced_code', 'nl2br', 'extra'] |
513 |
513 |
514 # version 2.0 supports only extension names, not instances |
514 # version 2.0 supports only extension names, not instances |
515 if markdown.version_info[0] > 2 or \ |
515 if markdown.version_info[0] > 2 or \ |
516 (markdown.version_info[0] == 2 and |
516 (markdown.version_info[0] == 2 and |
517 markdown.version_info[1] > 0): |
517 markdown.version_info[1] > 0): |
518 class _StrikeThroughExtension(markdown.Extension): |
518 class _StrikeThroughExtension(markdown.Extension): |
519 """ |
519 """ |
520 Class is placed here, because it depends on imported markdown, |
520 Class is placed here, because it depends on imported markdown, |
521 and markdown import is lazy. |
521 and markdown import is lazy. |