mirror of
https://github.com/kemko/liquid.git
synced 2026-01-13 21:45:44 +03:00
Compare commits
1 Commits
inline-com
...
ruby-3-ci
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc08579185 |
5
.github/workflows/liquid.yml
vendored
5
.github/workflows/liquid.yml
vendored
@@ -6,9 +6,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
entry:
|
entry:
|
||||||
- { ruby: 2.5, allowed-failure: false }
|
- { ruby: 2.5, allowed-failure: false } # minimum supported
|
||||||
- { ruby: 2.6, allowed-failure: false }
|
- { ruby: 3.0, allowed-failure: false } # latest
|
||||||
- { ruby: 2.7, allowed-failure: false }
|
|
||||||
- { ruby: ruby-head, allowed-failure: true }
|
- { ruby: ruby-head, allowed-failure: true }
|
||||||
name: test (${{ matrix.entry.ruby }})
|
name: test (${{ matrix.entry.ruby }})
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ require 'English'
|
|||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
class BlockBody
|
class BlockBody
|
||||||
LiquidTagToken = /\A\s*([\w#]+)\s*(.*?)\z/o
|
LiquidTagToken = /\A\s*(\w+)\s*(.*?)\z/o
|
||||||
FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om
|
FullToken = /\A#{TagStart}#{WhitespaceControl}?(\s*)(\w+)(\s*)(.*?)#{WhitespaceControl}?#{TagEnd}\z/om
|
||||||
ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om
|
ContentOfVariable = /\A#{VariableStart}#{WhitespaceControl}?(.*?)#{WhitespaceControl}?#{VariableEnd}\z/om
|
||||||
WhitespaceOrNothing = /\A\s*\z/
|
WhitespaceOrNothing = /\A\s*\z/
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
module Liquid
|
|
||||||
class InlineComment < Tag
|
|
||||||
def blank?
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
def render_to_output_buffer(_context, _output)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Template.register_tag('--', InlineComment)
|
|
||||||
end
|
|
||||||
|
|
||||||
@@ -461,6 +461,7 @@ class ContextTest < Minitest::Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_interrupt_avoids_object_allocations
|
def test_interrupt_avoids_object_allocations
|
||||||
|
@context.interrupt? # ruby 3.0.0 allocates on the first call
|
||||||
assert_no_object_allocations do
|
assert_no_object_allocations do
|
||||||
@context.interrupt?
|
@context.interrupt?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'test_helper'
|
|
||||||
|
|
||||||
class InlineCommentTest < Minitest::Test
|
|
||||||
include Liquid
|
|
||||||
|
|
||||||
def test_basic_usage
|
|
||||||
template_source = <<-END_TEMPLATE
|
|
||||||
foo{% # this is a comment %}bar
|
|
||||||
END_TEMPLATE
|
|
||||||
template = Template.parse(template_source)
|
|
||||||
rendered = template.render!
|
|
||||||
assert_equal("foobar", rendered.strip)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user