Fix spacing

This commit is contained in:
Mike Angell
2019-09-20 02:25:35 +10:00
parent 05c0bcf609
commit 26eb27f79f
78 changed files with 508 additions and 500 deletions
+3
View File
@@ -7,6 +7,9 @@ require: rubocop-performance
Performance:
Enabled: true
Layout/ExtraSpacing:
ForceEqualSignAlignment: true
AllCops:
TargetRubyVersion: 2.4
Exclude:
+1
View File
@@ -15,6 +15,7 @@ module Liquid
'?' => :question,
'-' => :dash,
}.freeze
IDENTIFIER = /[a-zA-Z_][\w-]*\??/
SINGLE_STRING_LITERAL = /'[^\']*'/
DOUBLE_STRING_LITERAL = /"[^\"]*"/
+3
View File
@@ -14,6 +14,7 @@ module Liquid
def consume(type = nil)
token = @tokens[@p]
if type && token[0] != type
raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
end
@@ -26,6 +27,7 @@ module Liquid
# or false otherwise.
def consume?(type)
token = @tokens[@p]
return false unless token && token[0] == type
@p += 1
token[1]
@@ -34,6 +36,7 @@ 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
+2 -1
View File
@@ -12,13 +12,14 @@ 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)