hamlit 2.15.1-java → 2.16.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ad29f71336e1e71fab1716562eb6e17dc21ab89536318f7be91e56991c42a76
4
- data.tar.gz: 19592da7e2ab8cf613933dcd838ecea68c9b843cfd06d9ac67f31c6eec1a71a1
3
+ metadata.gz: a7cdfbe8eb95f4bbef4250c9bbee1ac1b4a020b41a94bca2dbe7cb9f8c564a08
4
+ data.tar.gz: 3ea649ea9397fd0a7c6f1c93b0f28aecf8fe1480c34a1c2378347ef3bd9d15dd
5
5
  SHA512:
6
- metadata.gz: 34de923109facf23d50039433576861f6ae669b4b37771be879bd9a11ae94f190456435256c20d3ff5ca3d47e5f97e31ecbcc4c9df3e16b53e635ae8a435e4c1
7
- data.tar.gz: f0a89c63f0c777b1b236260d43d8e077c948dcddc477341abedd91d03f3d20d9a296a3c62de39548cc878739f65b57ccbe4196b9f6b52443e99b70c0fcb38841
6
+ metadata.gz: 03c7de215cba2311fa46b5da5a7077c1ebcb4649e7615b5ceb755591e5248877e5120125404f5488f4990682eb3fb43592854f77707b3b797b667df27b0e83dd
7
+ data.tar.gz: b4c5ec81e8382ce355040bbb17712f3a8b7d072d58c474621006007886544a954b5e1dde449f3fa7dab207a722a64146f459bc65ec7e8ef1c685fcbcc6d80c34
@@ -30,7 +30,7 @@ jobs:
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@v1
32
32
  with:
33
- ruby-version: 3.0
33
+ ruby-version: '3.0'
34
34
  - uses: actions/cache@v2
35
35
  with:
36
36
  path: vendor/bundle
data/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file. This
4
4
  project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
5
  [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
6
6
 
7
+ ## [2.16.1](https://github.com/k0kubun/hamlit/compare/v2.16.0...v2.16.1) - 2022-08-07
8
+
9
+ ### Added
10
+
11
+ - Introduce `:disable_capture` option to capture a block
12
+ - Default: `disable_capture: true` (backward-compatible)
13
+ - For Rails, this must be `true` anyway to use Rails-native capturing.
14
+ - If you override the option like `disable_capture: false` in Hamlit::Template,
15
+ you can capture a block content like `= render do ...`.
16
+
17
+ ## [2.16.0](https://github.com/k0kubun/hamlit/compare/v2.15.2...v2.16.0) - 2022-02-03
18
+
19
+ ### Added
20
+
21
+ - Raise an exception on a Haml-level syntax error with `hamlit compile -c`
22
+ [#189](https://github.com/k0kubun/hamlit/issues/189)
23
+ *Thanks to @dlwr*
24
+
25
+ ## [2.15.2](https://github.com/k0kubun/hamlit/compare/v2.15.1...v2.15.2) - 2022-01-04
26
+
27
+ ### Fixed
28
+
29
+ - Consider `playsinline` a boolean attribute [#187](https://github.com/k0kubun/hamlit/issues/187)
30
+ *Thanks to @ghiculescu*
31
+
7
32
  ## [2.15.1](https://github.com/k0kubun/hamlit/compare/v2.15.0...v2.15.1) - 2021-07-23
8
33
 
9
34
  ### Fixed
@@ -7,7 +7,7 @@ module Hamlit::AttributeBuilder
7
7
  defer reversed ismap seamless muted required
8
8
  autofocus novalidate formnovalidate open pubdate
9
9
  itemscope allowfullscreen default inert sortable
10
- truespeed typemustmatch download].freeze
10
+ truespeed typemustmatch download playsinline].freeze
11
11
 
12
12
  # Java extension is not implemented for JRuby yet.
13
13
  # TruffleRuby does not implement `rb_ary_sort_bang`, etc.
data/lib/hamlit/cli.rb CHANGED
@@ -106,6 +106,7 @@ module Hamlit
106
106
  Hamlit::Engine.options.to_h.merge(
107
107
  escape_attrs: options[:escape_attrs],
108
108
  escape_html: options[:escape_html],
109
+ check_syntax: options[:check],
109
110
  )
110
111
  end
111
112
 
@@ -6,8 +6,9 @@ require 'hamlit/string_splitter'
6
6
  module Hamlit
7
7
  class Compiler
8
8
  class ScriptCompiler
9
- def initialize(identity)
9
+ def initialize(identity, options)
10
10
  @identity = identity
11
+ @disable_capture = options[:disable_capture]
11
12
  end
12
13
 
13
14
  def compile(node, &block)
@@ -77,9 +78,10 @@ module Hamlit
77
78
  [:code, ')'],
78
79
  ]
79
80
  else
81
+ content = [:multi, [:newline], yield(node)]
80
82
  [:multi,
81
83
  [:block, "#{var} = #{node.value[:text]}",
82
- [:multi, [:newline], yield(node)],
84
+ @disable_capture ? content : [:capture, Temple::Utils.unique_name, content],
83
85
  ],
84
86
  ]
85
87
  end
@@ -16,7 +16,7 @@ module Hamlit
16
16
  @comment_compiler = CommentCompiler.new
17
17
  @doctype_compiler = DoctypeCompiler.new(options)
18
18
  @filter_compiler = Filters.new(options)
19
- @script_compiler = ScriptCompiler.new(identity)
19
+ @script_compiler = ScriptCompiler.new(identity, options)
20
20
  @silent_script_compiler = SilentScriptCompiler.new
21
21
  @tag_compiler = TagCompiler.new(identity, options)
22
22
  end
data/lib/hamlit/engine.rb CHANGED
@@ -21,6 +21,8 @@ module Hamlit
21
21
  hr img input isindex keygen link menuitem meta
22
22
  param source track wbr),
23
23
  filename: "",
24
+ check_syntax: false,
25
+ disable_capture: true,
24
26
  )
25
27
 
26
28
  use Parser
data/lib/hamlit/parser.rb CHANGED
@@ -20,6 +20,7 @@ module Hamlit
20
20
  autoclose
21
21
  escape_html
22
22
  escape_attrs
23
+ check_syntax
23
24
  ].freeze
24
25
 
25
26
  def initialize(options = {})
@@ -35,6 +36,7 @@ module Hamlit
35
36
  end
36
37
  HamlParser.new(HamlOptions.new(@options)).call(template)
37
38
  rescue ::Hamlit::HamlError => e
39
+ raise e if @options[:check_syntax]
38
40
  error_with_lineno(e)
39
41
  end
40
42
 
@@ -15,6 +15,7 @@ module Hamlit
15
15
  use_html_safe: true,
16
16
  streaming: true,
17
17
  buffer_class: 'ActionView::OutputBuffer',
18
+ disable_capture: true,
18
19
  }
19
20
  end
20
21
 
@@ -34,8 +35,10 @@ module Hamlit
34
35
  end
35
36
 
36
37
  if ActionView::Base.try(:annotate_rendered_view_with_filenames) && template.format == :html
37
- options[:preamble] = "<!-- BEGIN #{template.short_identifier} -->\n"
38
- options[:postamble] = "<!-- END #{template.short_identifier} -->\n"
38
+ options = options.merge(
39
+ preamble: "<!-- BEGIN #{template.short_identifier} -->\n",
40
+ postamble: "<!-- END #{template.short_identifier} -->\n",
41
+ )
39
42
  end
40
43
 
41
44
  Engine.new(options).call(source)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.15.1'
3
+ VERSION = '2.16.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamlit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.1
4
+ version: 2.16.1
5
5
  platform: java
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-23 00:00:00.000000000 Z
11
+ date: 2022-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  - !ruby/object:Gem::Version
360
360
  version: '0'
361
361
  requirements: []
362
- rubygems_version: 3.1.6
362
+ rubygems_version: 3.2.29
363
363
  signing_key:
364
364
  specification_version: 4
365
365
  summary: High Performance Haml Implementation