mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-04 01:25:14 -07:00
@@ -7,9 +7,6 @@ require: rubocop-performance
|
||||
Performance:
|
||||
Enabled: true
|
||||
|
||||
Layout/ExtraSpacing:
|
||||
ForceEqualSignAlignment: true
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.4
|
||||
Exclude:
|
||||
|
||||
@@ -15,7 +15,6 @@ module Liquid
|
||||
'?' => :question,
|
||||
'-' => :dash,
|
||||
}.freeze
|
||||
|
||||
IDENTIFIER = /[a-zA-Z_][\w-]*\??/
|
||||
SINGLE_STRING_LITERAL = /'[^\']*'/
|
||||
DOUBLE_STRING_LITERAL = /"[^\"]*"/
|
||||
|
||||
@@ -14,7 +14,6 @@ module Liquid
|
||||
|
||||
def consume(type = nil)
|
||||
token = @tokens[@p]
|
||||
|
||||
if type && token[0] != type
|
||||
raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
|
||||
end
|
||||
@@ -27,7 +26,6 @@ module Liquid
|
||||
# or false otherwise.
|
||||
def consume?(type)
|
||||
token = @tokens[@p]
|
||||
|
||||
return false unless token && token[0] == type
|
||||
@p += 1
|
||||
token[1]
|
||||
@@ -36,7 +34,6 @@ module Liquid
|
||||
# Like consume? Except for an :id token of a certain name
|
||||
def id?(str)
|
||||
token = @tokens[@p]
|
||||
|
||||
return false unless token && token[0] == :id
|
||||
return false unless token[1] == str
|
||||
@p += 1
|
||||
|
||||
@@ -12,14 +12,13 @@ module Liquid
|
||||
'"' => '"',
|
||||
"'" => ''',
|
||||
}.freeze
|
||||
|
||||
HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/
|
||||
STRIP_HTML_TAGS = /<.*?>/m
|
||||
STRIP_HTML_BLOCKS = Regexp.union(
|
||||
%r{<script.*?</script>}m,
|
||||
/<!--.*?-->/m,
|
||||
%r{<style.*?</style>}m
|
||||
)
|
||||
STRIP_HTML_TAGS = /<.*?>/m
|
||||
|
||||
# Return the size of an array or of an string
|
||||
def size(input)
|
||||
|
||||
Reference in New Issue
Block a user