-
Features
-
Bug fixes
- Bug fix: Leave parentheses in place in
'classA' ~ (not needsB ? ' classB')
- Bug fix (Melody): Whitespace trimming information was lost when using a conditional expression
- Bug fix: Expand the list of HTML tags treated as "inline"
- Bug fix: Filter expression was not correctly interpolated in a string
- Bug fix: Remove hard-coded space at the beginning of Twig comments
- Bug fix: Preserve leading (non-newline) whitespace in inline IF statement body
- Fix issue #1: Non-standard (custom) Twig tags don't make the parser crash any more, and receive at least some default printing. Complex tags can be configured using the
twigMultiTags
option.
- Fix issue #32: Curly braces around a binary expression were lost when they were in fact needed.
- Bug fix/optimization: ArrayExpression was causing too many newlines
- Bug fix: Filter target was losing parentheses, which was altering the meaning (e.g., conditional expression)
- Bug fix: Expressions like
not (a and b)
lost the parentheses, thus changing the meaning of the expression.
- Bug fix: Optimize group structure when using
SetStatement
,VariableDeclarationStatement
, and logical binary expressions. Previously, the group created bySetStatement
had only one breaking point (before the closing%}
), which led to some undesirable results.
- Fix:
twigMelodyPlugins
option is finally an array, not a string separated by|
any more.
- Fix: Stylistic improvements
- Bug fix: Mount statement of the form
mount ... from ...
were dropping the source. Fixed now.
- Bug fix: No breaking point before closing
%}
forfor
,if
,set
.
- Bug fixes
- Issue #24: Take the string contents into account when choosing the quote characters surrounding a string literal.
- Features
- Issue #22: Add
twigOutputEndblockName
option so that you can choose whether to print the name in the{% endblock %}
tag or not.
- Issue #22: Add
- Bug fixes
- Issue #21: Always use double quotes around interpolated strings
- Bug fixes
- Bug fixes
- Improve printing of HTML and Twig comments
-
Features
- Introduction of
prettier-ignore
functionality - Better adherence to Twig coding standards
- Introduction of
-
Bug fixes
- Avoid dropping of backslash in string literal: trivago#11
- Not crashing when facing declarations (
<!DOCTYPE html>
) any more
- Bug fixes
- Avoid extraneous line breaks for zero-argument call expressions: trivago#10
-
Features
- "If" statements can be in one line now, under certain circumstances
- New option
twigAlwaysBreakObjects
- New option
twigPrintWidth
- All util functions are public now (available to plugins)
- Optimizations: Fewer line breaks in a lot of cases, less indentation
- Long HTML comments are re-wrapped now
-
Bug fixes
- Respect operator precedence in binary expressions (especially boolean)
Various small bug fixes and cosmetic optimizations
- Bug fix
- Empty block was causing an error. Does not an more.
- Features
- Uses Melody 1.5.0
- Trim left and trim right marks are preserved for Twig tags
{%- ... -%}
- Features
- Uses Melody 1.4.0
- Whitespace trimming is now suppressed
- Trim left and trim right marks are preserved for expressions
{{- ... -}}
- Bug fixes:
- MacroDeclarationStatement: There was an extraneous space after the opening parenthesis
- Plugin loading: project root path was not always correctly determined
- Make use of new
melody-parser
capabilities:- Add comment printing
- Pass parser option to leave character entities undecoded
- Preserve HTML comments
- Fix issue #2, where all final newlines in a file were skipped. Now, there will be one final newline.
- Fix attribute printing in objects. Computed attributes are now surrounded by
(...)
. Keys that don't need quotes will not be quoted.