390 Commits

Author SHA1 Message Date
Liam Newman
4bc5fcc233 Add support for handlebars partials
Fixes #1756
2020-04-05 11:57:55 -07:00
Liam Newman
c006887868 Add support for es module
Fixes #1706
2020-04-05 09:33:16 -07:00
Liam Newman
a98a43d39d Add support for pipeline operator
Fixes #1530
2020-04-05 09:13:26 -07:00
Liam Newman
71089937ae
Merge pull request #1779 from bitwiseman/issue/1727
Support optional chaining
2020-04-05 09:11:11 -07:00
Liam Newman
81e9d4515c Support optional chaining 2020-04-05 09:02:31 -07:00
Liam Newman
35ed0cd218 Added optional closing of p tags
Fixes #1503
2020-04-03 17:33:25 -07:00
Liam Newman
739a91f862 Fix unquoted attributes with slashes in them
Fixes #1736
2020-01-14 10:51:45 -08:00
Michael Dombrowski
e28329c937 Add test for private field with changed output 2019-12-03 16:02:31 -08:00
Michael Dombrowski
c26968ab88 Allow # to start identifier, such as private fields in classes
To resolve #1734 , this change adds # which is hex 23 to begin an identifier name.
2019-12-01 17:07:30 -08:00
Orgad Shaneh
4473d62d46 Tests: Fix typo 2019-11-26 09:27:47 +02:00
Liam Newman
510cf7a9a8 Support handlebars unescaped triple curly-braces
Fixes #223
2019-07-18 14:21:40 -07:00
Liam Newman
2b64a03745 Only look for coment and cdata wrappers
Style and script elements can have their contents wrapped in cdata or an html comment.
Do not treat other text, such as php tag as though it were one of the wrappers.
2019-07-17 14:59:31 -07:00
Liam Newman
d6bb56cca5 Support for case with curly braces
Fixes #1357
2019-05-01 17:28:37 -07:00
Liam Newman
d299a74670 Add tests for #1233
Fixes #1233
2019-05-01 16:10:09 -07:00
Liam Newman
a4aa9bb079 Fix css escaping
Fixes #1667
2019-05-01 15:37:34 -07:00
Liam Newman
e60611044b Add templating language config option
1.9.x added better support for templating and turned it on for
Javascript by default. This caused formatting problems for code bases that
included template markers inside strings.

This change adds a templating option to control which languages are
recognized.  This setting defaults to "auto".  For JavaScript
"auto" means no templating languages, for HTML (and embedded script),
"auto" means all of them.  This basically preserves the existing
behavior before 1.9.x.

Fixes #1647
2019-04-30 10:11:52 -07:00
Liam Newman
caac81e7fb Do not repeat comments with indented empty line
Fixes #1663
2019-04-28 23:14:21 -07:00
Liam Newman
0cea554f21
Merge pull request #1664 from HanabishiRecca/master
LESS mixin fix
2019-04-27 19:51:10 -07:00
Liam Newman
12c476d997 Fix paren indenting 2019-04-27 19:14:13 -07:00
Liam Newman
737b425ad2 Add tests 2019-04-23 10:19:50 -07:00
Hanabishi
ed7138e598 LESS pseudoclass inside a mixin fix 2019-04-22 17:59:35 +05:00
Hanabishi
c374263b5a LESS mixin fix 2019-04-21 02:07:29 +05:00
Liam Newman
ff25fa565c Only recognize html comments as wrappers for javascript 2019-04-16 12:27:06 -07:00
Liam Newman
3296dd0d85 Support wrapping script and style content
Content inside style and script tags can be wrapped in comment or
cdata to allow the text to contain characters and string that
would otherwise not be allowed in html.

Before this change the html beautifier would not see the wrappers.
This meant that it could incorrectly terminate script or style
tags. It also meant that the wrapper would be passed to child
beautifiers and they would have to handle them.

This change makes the html beautfier recognize the wrappers and
correctly handle formatting of them itself. The child beautifiers
see only the content not the wrapper.

Fixes #1641
2019-04-16 12:27:05 -07:00
Hanabishi
a94020125c Changed css tests to use 4 space indenting instead of tabs 2019-04-12 08:35:45 -07:00
asteinha
7400264bf3 Fixing test sources. 2019-04-12 02:09:37 +02:00
Avery Bloom
7111267cf8 stop reformatting valid css \! into invalid \ ! 2019-04-07 13:30:10 +09:00
HanabishiRecca
3470ea5013 CSS & HTML tests 2019-03-25 13:21:06 -07:00
HanabishiRecca
212fe615e6 Additional tests 2019-03-25 13:21:06 -07:00
HanabishiRecca
8f9d86947f Option renamed
preserve_empty_lines_indent -> indent_empty_lines
2019-03-25 13:21:06 -07:00
Liam Newman
6db4a03841 Add initial tests 2019-03-25 13:21:06 -07:00
Liam Newman
1f7af59468 Limit tag auto-close for td and th tags
Fixes #1649
2019-03-25 13:20:15 -07:00
Liam Newman
bbc0e8e3d4 Fix newline insertion for optional end tags
Fixes #1213
2019-01-30 10:35:18 +01:00
Liam Newman
f6ed35d9c7 Fix identifier unicode escape recognition
Fixed #1211
2019-01-30 09:51:10 +01:00
e2tha-e
33db5b548a comment referring to issue which new inverted section test addresses 2019-01-29 13:30:13 -05:00
e2tha-e
3ccb604cb8 added test for indenting handlebars/mustache inverted sections 2019-01-29 12:11:47 -05:00
Liam Newman
f57eaff4de Template handling in JavaScript
Fixes #1377
2019-01-25 19:11:21 -08:00
Liam Newman
a6c908bd61 Add minimal support for django and other templating
Fixes #993
2019-01-17 21:51:35 -08:00
Liam Newman
797aa8e998 Template handling in HTML 2019-01-17 00:17:32 -08:00
Liam Newman
579ea06ca1 Add unformatted_content_delimiter
Fixes #1560
2019-01-13 12:54:27 -08:00
Liam Newman
8131d2713f Complete conversion to new line wrapping
Fixes #284
2019-01-13 10:38:19 -08:00
Liam Newman
17aa974e90 Move more tests to data files 2019-01-13 10:04:43 -08:00
Liam Newman
9a9c4f5358 Move Javascript to new line wrapping 2019-01-12 14:30:48 -08:00
Liam Newman
c6562be40a Enable strong line wrapping on html
Fixes #1324
2019-01-12 11:56:45 -08:00
Liam Newman
1c1784798f Improve attribute wrapping
Fixes #1238
2019-01-10 12:18:46 -08:00
Liam Newman
83b65645cd Enable ignore directive in css 2019-01-09 14:35:51 -08:00
Liam Newman
68f6494dd0 Correctly handle type attribute on non-script tags
Fixes #1606
2019-01-07 23:38:59 -08:00
Liam Newman
bdf611c671 Fix null beautifier and add tests
Fixes #1590
2018-12-08 18:43:50 -08:00
Liam Newman
f79082e441 Add html/text support to script tag
Fixes #1591

NOTE: This is a potentially breaking change to existing behavior.
Whitespace at the start of html used to be ignored.
Now it will be used as the base indent for the rest of the input.
This makes it consistent with the other beautifiers but may change
the behaviors of libraries that use the beautifier.
2018-12-08 17:20:19 -08:00
Liam Newman
4412cc970c
Merge branch 'master' into tab_wrap 2018-12-05 20:22:12 -08:00