eric6/QScintilla/MarkupProviders/__init__.py

changeset 7267
aedc309827c7
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7266:d001bc703c29 7267:aedc309827c7
27 27
28 if fn: 28 if fn:
29 extension = os.path.normcase(os.path.splitext(fn)[1][1:]) 29 extension = os.path.normcase(os.path.splitext(fn)[1][1:])
30 else: 30 else:
31 extension = "" 31 extension = ""
32 if extension in \ 32 if (
33 Preferences.getEditor("PreviewHtmlFileNameExtensions") or \ 33 extension in Preferences.getEditor(
34 editor.getLanguage() == "HTML": 34 "PreviewHtmlFileNameExtensions") or
35 editor.getLanguage() == "HTML"
36 ):
35 from .HtmlProvider import HtmlProvider 37 from .HtmlProvider import HtmlProvider
36 return HtmlProvider() 38 return HtmlProvider()
37 elif extension in \ 39 elif (
38 Preferences.getEditor("PreviewMarkdownFileNameExtensions") or \ 40 extension in Preferences.getEditor(
39 editor.getLanguage().lower() == "markdown": 41 "PreviewMarkdownFileNameExtensions") or
42 editor.getLanguage().lower() == "markdown"
43 ):
40 from .MarkdownProvider import MarkdownProvider 44 from .MarkdownProvider import MarkdownProvider
41 return MarkdownProvider() 45 return MarkdownProvider()
42 elif extension in \ 46 elif (
43 Preferences.getEditor("PreviewRestFileNameExtensions") or \ 47 extension in Preferences.getEditor(
44 editor.getLanguage().lower() == "restructuredtext": 48 "PreviewRestFileNameExtensions") or
49 editor.getLanguage().lower() == "restructuredtext"
50 ):
45 from .RestructuredTextProvider import RestructuredTextProvider 51 from .RestructuredTextProvider import RestructuredTextProvider
46 return RestructuredTextProvider() 52 return RestructuredTextProvider()
47 53
48 # no supported markup provider identified 54 # no supported markup provider identified
49 from .MarkupBase import MarkupBase 55 from .MarkupBase import MarkupBase

eric ide

mercurial