forked from slim-template/slim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGES
370 lines (277 loc) · 12.8 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
master
* slimrb: Don't update HTML output on exceptions
* Allow dashes at the beginning of class names (#474)
* Render empty attributes as standalone in html mode (#480)
* Fix #482: problem with whitespace modifier `tag=<`
* Fix #485: missing end for empty `if` control blocks
2.0.2
* Add option :attr_delims
2.0.1
* Support multiple attributes per shortcut (See issue #415)
* Add support for org-ruby embedded engine
* Render true boolean attributes with empty value
* Support case-when statements
* Fix issue #431
* Also escape ' to '
2.0.0
* IMPORTANT: Backward incompatible syntax change: '{...}' and '[...]' are not
allowed as ruby attribute wrappers anymore. Use parentheses '(...)'
if you want to wrap code with spaces. This allows to write arrays and hashes directly.
Old:
div id={'obj' + name} data=({:a => 1, :b => 2}) class=['alpha', 'beta']
New:
div id=('obj' + name) data={:a => 1, :b => 2} class=['alpha', 'beta']
* Quoted attributes are escaped by default
Old:
a href='http://slim-lang.com/?a=1&b=2'
New:
a href='http://slim-lang.com/?a=1&b=2'
a href=='http://slim-lang.com/?a=1&b=2'
You can always disable escaping completly by using :disable_escape if you don't want to write '=='.
* Added hyphenation support for data attributes (Option :hyphen_attrs)
Example: div data={key1_key2: 2, key1: {key3: 3}} will render as '<div data-key1-key2="2" data-key1-key3="3"></div>'
* Removed deprecated options:
- :escape_quoted_attrs
- :remove_empty_attrs
- :chain
- :attr_wrapper (renamed to :attr_quote)
- :attr_delimiter (renamed to :merge_attrs)
- Slim::LogicLess :wrapped dictionary
- Slim::Parser :shortcut string option
* Allow spaces around attributes, e.g 'a [ href = url ] text' and 'a href = url text'
* Add unicode support for tags and attributes (Issue #212)
* Generate missing `do` keywords for code blocks (see #342)
* Logic-less: Add keyword `self` for string access
* Added Slim::ERBConverter, require 'slim/erb_converter'
* Added option '-e' for ERB conversion to slimrb
* Add syntax for trailing or leading whitespace after tag, e.g. input>, input<
* Add syntax for trailing or leading whitespace after output, e.g. =>, =<
1.3.8
* Disable some superflous deprecation warnings
1.3.7
* Fixed issue #374, rescue and ensure blocks
* Fixed issue #333 (Throw syntax error if you write text after closed tag)
* Deprecated :attr_delimiter (renamed to :merge_attrs)
* Deprecated :attr_wrapper (renamed to :attr_quote)
* Warn if you use curly braces or brackets for ruby attributes since
curly braces and brackets will be interpreted as Hash/Array in Slim 2.0.0
Old syntax:
div id={person && person.id}
div id=[person && person.id]
New syntax in 2.0.0:
div id=(person && person.id)
* Deprecated :escape_quoted_attrs (done by default in 2.0)
* Warn if quoted attributes might be double escaped in Slim 2.0.0
Old syntax:
a href='http://slim-lang.com/?a=1&b=2'
a href=='http://slim-lang.com/?a=1&b=2'
New syntax in 2.0.0:
a href='http://slim-lang.com/?a=1&b=2'
a href=='http://slim-lang.com/?a=1&b=2'
* Improved pretty printing (Issue #202)
* Renamed Slim::EmbeddedEngine to Slim::Embedded (Old constant still available until 2.0)
* Renamed Slim::ControlStructures to Slim::Controls
* Tab expansion improved (tab + space is interpreted as equivalent to tab)
* Support for wrapping javascript in HTML comments or CDATA (Issue #340)
* Asciidoc embedded engine added
1.3.6
* Allow attribute values to be broken with `\` (Issue #331)
* Tag shortcuts implemented (Issue #306)
* Hash format of Slim::Parser option :shortcut changed, old configuration deprecated but still supported
1.3.5
* Logic-less:
- Rewrote logic-less mode (Issue #326, #327)
- Logic-less mode supports lambdas
- Option :dictionary_access made more powerful, value :wrapped deprecated
1.3.4
* Fixed #314
* Logic-less test cases added
1.3.3
* Attribute handling made consistent:
- Splat attributes, static and dynamic attributes are now all handled the same
- Merged attributes are removed if empty (in the default configuration this is only "class")
- Dynamic attributes which are not merged are checked for false or nil and removed if this is the case
- Dynamic attributes which are not merged are checked for true and generated as attribute-name="attribute-name"
* Rename class BooleanAttributes to CodeAttributes
* Add literate test suite (still incomplete), run with `rake test:literate`
* Remove UTF BOM when parsing Slim code
* Fixed issue #303
1.3.2
* Fix boolean attributes #299
1.3.1
* Support inline html at the beginning of a line (New line indicator <). No pipe symbol is | necessary.
It is even possible to wrap other Slim syntax in such a html block.
* Code restructured - Handling of boolean and splat attributes improved and PERFORMANCE improved.
* BACKWARD INCOMPATIBLE CHANGE - Dynamic attributes which return empty value "" are not removed anymore
(this means "" is now interpreted as true), whereas false and nil are still removed.
This corresponds to the definition of boolean attributes in XHTML and HTML5.
* Deprecated option :remove_empty_attrs (TODO: Remove in 1.4.0)
* Add option :escape_quoted_attrs to escape quoted attributes, use == if you don't want that.
The default is false to stay backward compatible.
* Use Temple::FilterError exception
* Use Temple::Parser
* / is not escaped anymore to /
* Parser: check for missing closing quote in quoted attributes
* Use new temple option validation to make Slim configuration more user friendly.
* Support thread options Slim::Engine.with_options which especially useful for Rails
* Add explicit column number to SyntaxError.to_s
1.3.0
* Parser wraps text blocks in [:slim, :text, ...] (Used by Translator/I18n plugin)
* Added Translator/I18n plugin which uses GetText or FastGettext (require 'slim/translator')
* Moved logic less mode out of the core to plugin (require 'slim/logic_less')
1.2.2
* Fix issue #264
1.2.1
* Support stylus as embedded engine
* Fix issue #257
1.2.0
* Add option :shortcut which configures attribute shortcuts
Default setting:
Slim::Parser.default_options[:shortcut] = {'#' => 'id', '.' => 'class', '*' => '*'}
Define custom shortcut attribute (e.g. a@ajax-link renders <a role="ajax-link"></a>)
Slim::Parser.default_options[:shortcut] = {'@' => 'role'}
Define custom shortcut attribute with tag (e.g. @ajax-link renders <a role="ajax-link"></a>)
Slim::Parser.default_options[:shortcut] = {'@' => 'a role'}
* Add syntax for splat attributes (#109)
* Support for dynamic tags, e.g. *{:tag => 'img', :src => 'image.jpg'}
1.1.1
* Evaluating a html attribute now happens only once (#219)
* Code with trailing comma is treated as broken line (#226)
* Support option :remove_empty_attrs (default true)
* Require temple 0.4.0
1.1.0
* Support for special characters in class/id shortcut removed
* Do not allow : in class/id shortcut
* Add support for block expansion syntax
* Support options :indent, :sort_attrs
* Require temple 0.3.5
1.0.4
* Pass options to embedded Tilt engine
Slim::EmbeddedEngine.set_default_options :markdown => {...}
* Add test case for precompiled embedded engine 'builder'
* Bug #204 fixed, tabs were not parsed correctly
1.0.3
* Fix rubinius test cases
* Fix line numbers for embedded engines
* Require temple 0.3.4
* Remove dynamic embedded engines Haml, Liquid, Radius, Markaby
* More thorough integration testing using travis-ci
See http://travis-ci.org/#!/stonean/slim
* Empty static attributes are not removed anymore
* Line indicator =' is supported in tags
1.0.2
* Support for Rails 3.1 streaming (Temple > 0.3.2 required)
* Switch to default format xhtml (supports all doctypes, including html5)
* Improve parsing of #{interpolation} in quoted attributes (issue #159)
* Use travis-ci for continous integration testing
1.0.1
* Only delimiting brackets must be balanced in ruby attributes
e.g this is possible now `a href=(ruby_code "{")
* Skip empty lines in text block (#156)
1.0.0
* Fixed html attribute issue in sections mode (#127)
* Obsolete directive syntax removed
* Syntax for trailing whitespace added (==' and =')
* Deprecated file 'slim/rails.rb' removed
* Parsing of #{interpolation} in markdown fixed
* Support for attributes which span multiple lines
* Dynamic attributes with value true/false are interpreted as boolean
* Support boolean attributes without value e.g. option(selected id="abc")
0.9.3
* Allow for bypassing escaping in attributes
* check if string encoding is valid
* support for html conditional comments
* Use new Temple html attribute expression [:html, :attrs, [:html, :attr, ...], ...]
* Use new slim html attribute expression (similiar to Temple)
* Option :id_delimiter replaced with :attr_delimiter
* Attribute value merging improved (nil/empty values are ignored now)
* Arrays attribute values are joined
* Boolean attributes (e.g. selected=true is converted to selected="selected")
* Option :debug removed
* Slim expression grammar provided, Temple validator used in tests
* Option :auto_escape replaced with inverse option :disable_escape
* Require temple 0.3.0
0.9.2
* add SassEngine which respects :pretty
* embedded engine code refactored
* temple supports denser template registration
* deprecate slim/rails (just require 'slim')
* use temple rails and tilt templates
* add encoding option to Slim::Parser/Slim::Engine to enforce template encoding
* vim support is now an external project
0.9.1
* add new doctype syntax without !
* slim directive expression has type and args
0.9.0
* slim should not be registered as the default template handler.
* add support for unescaped text interpolation
0.8.4
* Added the option to turn off automatic HTML escaping.
* update to tilt 1.2.2
* allow call to yield in logic less mode
* allow doctype declaration to be capitalized
0.8.3
* Added support for html comments. The parser uses the :static filter instead of the :comment filter due to the way the parser is constructed.
0.8.2
* fix issue #96
* Added the Temple Debugger filter.
* Rails problems fixed
0.8.1
* remove backtick slim syntax -- no longer supported
* slim executable conflict. issue #91
* vim syntax support improved
0.8.0
* rails logic less support
0.7.4
* use ' for text block with trailing whitespace
* allow to disable/enable embedded engines
0.7.3
* fix #82
* basic rails test added
0.7.2
* get rid of rails deprecation warning
* use_html_safe is activated automatically by temple
0.7.1
* logic less mode
* add syntax for explicitly closed tags
0.7.0
* slim-mode.el for emacs added (modified haml-mode.el, needs some work to be fully functional for slim)
* embedded engines
* escape interpolated strings/attributes
* Slim#Filter now uses optional configuration hash
* Initial implementation for Rail's `html_safe`. Closes #25
* fallback to escape_html stolen from cgi.rb if escape_utils is unavailable, use normal requires because slim is on the load path
* Limit the allowed characters used for attributes delimiters (now only allows parentheses, square brackets and curly braces). See #16 for more info.
* Default to HTML5-mode
* Slim now uses Temple and Tilt.
* Choose your own attribute delimiter!
0.6.1
* can wrap parens around attributes if you so desire
* added erubis to the benchmarks
0.6.0
* Added slim itself, haml and mustache to the development env for easier benchmarking.
* added escape_html functionality. need to tweak for speed
0.5.1
* Consecutive condition statements now working as expected.
0.5.0
* Added 'unless' to the list of control words.
* Fixes for inline conditions. There must be a better way of doing this??
* '-' is a valid character in HTML attributes, so let's allow that.
* Improved the regex so that control code now supports code blocks.
* Output code (start with '=') can now accept code blocks.
* Method calls no longer need parenthesis. We need more tests to ensure the implementation's robustness.
0.4.1
* Added '|' as an alias of '`' for parsing plain text. This simulates the syntax of the Jade template engine.
* Added instructions of how to use the gem.
0.4.0
* support for nesting lines under backtick
* make it so that one space is the left margin. any additional spaces will be copied over
* support for using indentation after backtick to denote paragraphs. useful for script tags and paragraphs
0.3.1
* fix bug with adding end to nesting ruby code
0.3.0
* Optimize compiled string to reduce number of concatentations to the buffer
0.2.0
* can now make code call on same line as tag
0.1.0
* Initial release