From 264a1c524b90359625da0063e232a137eff96f67 Mon Sep 17 00:00:00 2001 From: Keith Hall Date: Tue, 1 Sep 2020 10:01:43 +0300 Subject: [PATCH] [HTML] don't indent after DOCTYPE, add indentation tests --- HTML/Indentation Rules.tmPreferences | 5 +++-- HTML/syntax_test_html_indentation.html | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 HTML/syntax_test_html_indentation.html diff --git a/HTML/Indentation Rules.tmPreferences b/HTML/Indentation Rules.tmPreferences index 4445dc6d6a..b9b896259b 100644 --- a/HTML/Indentation Rules.tmPreferences +++ b/HTML/Indentation Rules.tmPreferences @@ -26,8 +26,9 @@ ^.* ( # a valid non-self-closing HTML tag that doesn't close itself on the same line <(?! - !-- # no comment - | [?%] # no section + !-- # no comment + | [?%] # no preprocessor section like PHP/ASP + | !DOCTYPE # no document type | (?i:area|base|br|col|frame|hr|html|img|input|link|meta|param)[\t\n\f /<>] )(?: # tag name diff --git a/HTML/syntax_test_html_indentation.html b/HTML/syntax_test_html_indentation.html new file mode 100644 index 0000000000..f5c4d42fc3 --- /dev/null +++ b/HTML/syntax_test_html_indentation.html @@ -0,0 +1,24 @@ +## SYNTAX TEST reindent-unchanged "Packages/HTML/HTML.sublime-syntax" + + + + + + Page Title Here + + + + +
+ Blah + + Foobar + +
+ + + +