mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
templates: Mark all void tags as self-closing.
This reverses the policy that was set, but incompletely enforced, by
commit 951514dd7d. The self-closing tag
syntax is clearer, more consistent, simpler to parse, compatible with
XML, preferred by Prettier, and (most importantly now) required by
FormatJS.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7177529107
commit
dd3fa4ac52
@@ -260,23 +260,23 @@ class ParserTest(unittest.TestCase):
|
||||
validate(text=my_html)
|
||||
|
||||
def test_tokenize(self) -> None:
|
||||
tag = "<meta whatever>bla"
|
||||
tag = "<!DOCTYPE html>"
|
||||
token = tokenize(tag)[0]
|
||||
self.assertEqual(token.kind, "html_special")
|
||||
self.assertEqual(token.kind, "html_doctype")
|
||||
|
||||
tag = "<a>bla"
|
||||
token = tokenize(tag)[0]
|
||||
self.assertEqual(token.kind, "html_start")
|
||||
self.assertEqual(token.tag, "a")
|
||||
|
||||
tag = "<br>bla"
|
||||
tag = "<br />bla"
|
||||
token = tokenize(tag)[0]
|
||||
self.assertEqual(token.kind, "html_singleton")
|
||||
self.assertEqual(token.tag, "br")
|
||||
|
||||
tag = "<input>bla"
|
||||
token = tokenize(tag)[0]
|
||||
self.assertEqual(token.kind, "html_singleton")
|
||||
self.assertEqual(token.kind, "html_start") # We later mark this an error.
|
||||
self.assertEqual(token.tag, "input")
|
||||
|
||||
tag = "<input />bla"
|
||||
|
||||
Reference in New Issue
Block a user