File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
7
7
## [ Unreleased]
8
8
9
+ ## [ 0.10.5] - 2023-09-03
10
+
9
11
- Handle ERB-tags inside HTML-tags, like ` <div <%= "class='foo'" %>> `
10
12
- Handles indentation for multiline ERB-comment
13
+ - Handles spaces between do-arguments and ERB-tags
11
14
12
15
## [ 0.10.4] - 2023-08-28
13
16
@@ -106,7 +109,8 @@ Output:
106
109
- Can format a lot of .html.erb-syntax and works as a plugin to syntax_tree.
107
110
- This is still early and there are a lot of different weird syntaxes out there.
108
111
109
- [ unreleased ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.4...HEAD
112
+ [ unreleased ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.5...HEAD
113
+ [ 0.10.5 ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.4...v0.10.5
110
114
[ 0.10.4 ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.3...v0.10.4
111
115
[ 0.10.3 ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.2...v0.10.3
112
116
[ 0.10.2 ] : https://github.com/davidwessman/syntax_tree-erb/compare/v0.10.1...v0.10.2
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- w_syntax_tree-erb (0.10.4 )
4
+ w_syntax_tree-erb (0.10.5 )
5
5
prettier_print (~> 1.2 , >= 1.2.0 )
6
6
syntax_tree (~> 6.1 , >= 6.1.1 )
7
7
Original file line number Diff line number Diff line change @@ -121,7 +121,10 @@ def visit_erb(node)
121
121
end
122
122
123
123
def visit_erb_do_close ( node )
124
- visit ( node . closing )
124
+ closing = node . closing . value . end_with? ( "-%>" ) ? "-%>" : "%>"
125
+ q . text ( node . closing . value . gsub ( closing , "" ) . rstrip )
126
+ q . text ( " " )
127
+ q . text ( closing )
125
128
end
126
129
127
130
def visit_erb_close ( node )
Original file line number Diff line number Diff line change 2
2
3
3
module SyntaxTree
4
4
module ERB
5
- VERSION = "0.10.4 "
5
+ VERSION = "0.10.5 "
6
6
end
7
7
end
Original file line number Diff line number Diff line change @@ -139,6 +139,14 @@ def test_erb_whitespace
139
139
assert_formatting ( source , expected )
140
140
end
141
141
142
+ def test_erb_block_do_arguments
143
+ source = "<%= link_to(url) do |link, other_arg|%>Whaaaaaaat<% end %>"
144
+ expected =
145
+ "<%= link_to(url) do |link, other_arg| %>\n Whaaaaaaat\n <% end %>\n "
146
+
147
+ assert_formatting ( source , expected )
148
+ end
149
+
142
150
def test_erb_newline
143
151
source = "<%= what if this %>\n <h1>hej</h1>"
144
152
expected = "<%= what if this %>\n <h1>hej</h1>\n "
You can’t perform that action at this time.
0 commit comments