Coverage for C:\Repos\leo-editor\leo\plugins\importers\html.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v6.4, created at 2022-05-24 10:21 -0500

1#@+leo-ver=5-thin 

2#@+node:ekr.20140723122936.18138: * @file ../plugins/importers/html.py 

3"""The @auto importer for HTML.""" 

4from leo.plugins.importers import xml 

5Xml_Importer = xml.Xml_Importer 

6#@+others 

7#@+node:ekr.20140723122936.18136: ** class Html_Importer(Xml_Importer) 

8class Html_Importer(Xml_Importer): 

9 

10 def __init__(self, importCommands, **kwargs): 

11 """Html_Importer.__init__""" 

12 super().__init__(importCommands, 

13 tags_setting='import_html_tags') 

14 self.name = 'html' 

15 self.void_tags = [ 

16 # A small kludge: add !DOCTYPE. 

17 '!doctype', 

18 # void elements in HTML 4.01/XHTML 1.0 Strict: 

19 'area', 'base', 'br', 'col', 'hr', 'img', 'input', 'link', 'meta', 'param', 

20 # void elements in HTML5: 

21 'command', 'keygen', 'source', 

22 ] 

23#@-others 

24importer_dict = { 

25 'func': Html_Importer.do_import(), 

26 'extensions': ['.html', '.htm',], 

27} 

28#@@language python 

29#@@tabwidth -4 

30#@-leo