|
9 | 9 | from elements.var import Var |
10 | 10 | from elements.loop import Loop |
11 | 11 | from elements.link import Link, Script |
| 12 | +from elements.doctype import Doctype |
12 | 13 | from html_parser import HTMLParser |
13 | 14 | from utils import camel_case_to_hyphenated |
14 | 15 |
|
@@ -47,7 +48,8 @@ def __init__(self, dir, filename): |
47 | 48 | Return, |
48 | 49 | Comment, # <!-- this is a comment --> OR <comment text="this is a comment"/> |
49 | 50 | Link, # <link type="text/html" href="./include-this-file.html"/> |
50 | | - Script # <script type="text/html" src="./include-this-file.html"/> |
| 51 | + Script, # <script type="text/html" src="./include-this-file.html"/> |
| 52 | + Doctype |
51 | 53 | ] |
52 | 54 |
|
53 | 55 | def handle_starttag(self, tagname, attrs, line): |
@@ -95,6 +97,10 @@ def handle_comment(self, comment_text, line): |
95 | 97 | self.handle_starttag("comment", {"text": comment_text}, line) |
96 | 98 | self.handle_closingtag("comment", line) |
97 | 99 |
|
| 100 | + def handle_doctype(self, doctype, line): |
| 101 | + self.handle_starttag("doctype", {"text": doctype}, line) |
| 102 | + self.handle_closingtag("doctype", line) |
| 103 | + |
98 | 104 | def new_element_by_tagname(self, tagname): |
99 | 105 | """ |
100 | 106 | Creates an new element based on the tagname. |
|
0 commit comments