Skip to content

Commit

Permalink
[WIP] Closing tag -- Net wins
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownPlatypus committed Jan 5, 2025
1 parent 90e304b commit e110611
Show file tree
Hide file tree
Showing 37 changed files with 383 additions and 808 deletions.
2 changes: 1 addition & 1 deletion markup_fmt/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ impl<'s> DocGen<'s> for Element<'s> {
docs.push(
Doc::text("</")
.append(Doc::text(formatted_tag_name))
.append(Doc::line_or_nil())
// .append(Doc::line_or_nil())
.append(Doc::text(">"))
.group(),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ source: markup_fmt/tests/fmt.rs
text
</span>
<span
long_long_attribute="long_long_long_long_long_long_long_long_long_long_long_value"></span
>
long_long_attribute="long_long_long_long_long_long_long_long_long_long_long_value"></span>
<span class="a">text</span>
<span
long_long_attribute="long_long_long_long_long_long_long_long_long_long_long_value">
Expand All @@ -17,5 +16,5 @@ source: markup_fmt/tests/fmt.rs
long_long_attribute="long_long_long_long_long_long_long_long_long_long_long_value">
text
</span>
<span class="a">text</span><span class="a">text</span><span class="a">text</span
><span class="a">text</span><span class="a">text</span>
<span class="a">text</span><span class="a">text</span><span
class="a">text</span><span class="a">text</span><span class="a">text</span>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
source: markup_fmt/tests/fmt.rs
---
<div></div>
<div
class="long-long-long-long-long-attribute"
></div>
<div class="long-long-long-long-long-attribute"></div>
132 changes: 43 additions & 89 deletions markup_fmt/tests/fmt/html/comments/conditional.small-print-width.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,35 @@ source: markup_fmt/tests/fmt.rs
<!--[if IE 7]>This is IE 7<br><![endif]-->
<!--[if IE 8]>This is IE 8<br><![endif]-->
<!--[if IE 9]>This is IE 9<br><![endif]-->
</body
>
</html
>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html lang="zh-CN"><![endif]-->
<html
lang="zh-CN"
>
<head
>
</head
>
<body
>
</body
>
</html
>
<html lang="zh-CN">
<head>
</head>
<body>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html lang="zh-CN"><div><![endif]-->
<html
lang="zh-CN"
>
<head
>
</head
>
<body
>
</body
>
</html
>
<html lang="zh-CN">
<head>
</head>
<body>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html lang="zh-CN"><div></div><![endif]-->
<html
lang="zh-CN"
>
<head
>
</head
>
<body
>
</body
>
</html
>
<html lang="zh-CN">
<head>
</head>
<body>
</body>
</html>

<body
width="100%"
Expand All @@ -71,32 +48,23 @@ source: markup_fmt/tests/fmt.rs
<center
>
<!--[if (gte mso 9)|(IE)]><table cellpadding="0" cellspacing="0" border="0" width="600" align="center"><tr><td><![endif]-->
<div
>
</div
>
<div>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</center
>
</body
>
</center>
</body>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="legacy-ie"><![endif]-->
<!--[if gte IE 9]><!-->
<html
>
<!--<![endif]-->
<head
>
</head
>
<body
>
</body
>
</html
>
<head>
</head>
<body>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="legacy-ie"><![endif]-->
Expand All @@ -105,16 +73,11 @@ source: markup_fmt/tests/fmt.rs
hello
>
<!--<![endif]-->
<head
>
</head
>
<body
>
</body
>
</html
>
<head>
</head>
<body>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="legacy-ie"><head><![endif]-->
Expand All @@ -124,14 +87,10 @@ source: markup_fmt/tests/fmt.rs
<head
>
<!--<![endif]-->
</head
>
<body
>
</body
>
</html
>
</head>
<body>
</body>
</html>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="legacy-ie"><![endif]-->
Expand All @@ -140,13 +99,8 @@ source: markup_fmt/tests/fmt.rs
<html
>
<!--<![endif]-->
<head
>
</head
>
<body
>
</body
>
</html
>
<head>
</head>
<body>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ source: markup_fmt/tests/fmt.rs
<!-- Do not display this at the moment
<img border="0" src="pic_trulli.jpg" alt="Trulli">
-->
</body
>
</html
>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ source: markup_fmt/tests/fmt.rs
is
a
paragraph.
</p
>
</p>
<!-- Comments are not displayed in the browser -->
</body
>
</html
>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ source: markup_fmt/tests/fmt.rs
<li
>
First
</li
>
</li>
<!-- 123
456
789
-->
<li
>
Second
</li
>
</li>
<!--


Expand All @@ -31,8 +29,7 @@ source: markup_fmt/tests/fmt.rs
<li
>
Second
</li
>
</li>
<!--


Expand All @@ -42,40 +39,30 @@ source: markup_fmt/tests/fmt.rs


-->
</ul
>
</ul>
<span
><!--
--><span
>a</span
><!--
>a</span><!--
--><span
>b</span
><!--
--></span
>
>b</span><!--
--></span>

<span
><!-- 1
--><span
>a</span
><!-- 2
>a</span><!-- 2
--><span
>b</span
><!-- 3
--></span
>
>b</span><!-- 3
--></span>

<span
><!--
1 --><span
>a</span
><!--
>a</span><!--
2 --><span
>b</span
><!--
3 --></span
>
>b</span><!--
3 --></span>

123<!---->456
123<!--x-->456
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ source: markup_fmt/tests/fmt.rs
--><li>First</li><!-- 123
456
789
--><li>Second</li
><!--
--><li
>Second</li><!--


123
456
789


--><li>Second</li
><!--
--><li
>Second</li><!--


123
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ source: markup_fmt/tests/fmt.rs
<CaseSensitive
CaseSensitive="true"
>hello
world</CaseSensitive
>
world</CaseSensitive>
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ source: markup_fmt/tests/fmt.rs
aaaaaaaaaa
<a
href="longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"
>bbbbbbbbbb</a
>
>bbbbbbbbbb</a>
cccccccccc
</div
>
<div
>
</div>
<div>
aaaaaaaaaa
<a
href="longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong"
>bbbbbbbbbb</a
>cccccccccc
</div
>
>bbbbbbbbbb</a>cccccccccc
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
source: markup_fmt/tests/fmt.rs
---
<app-foo
></app-foo
>
></app-foo>
<app-bar
></app-bar
>
></app-bar>
Loading

0 comments on commit e110611

Please sign in to comment.