Revert "Fix spacing"

This reverts commit 26eb27f79f.
This commit is contained in:
Mike Angell
2019-09-20 02:42:21 +10:00
parent 26eb27f79f
commit 00c8ca559a
78 changed files with 500 additions and 508 deletions
-3
View File
@@ -7,9 +7,6 @@ require: rubocop-performance
Performance: Performance:
Enabled: true Enabled: true
Layout/ExtraSpacing:
ForceEqualSignAlignment: true
AllCops: AllCops:
TargetRubyVersion: 2.4 TargetRubyVersion: 2.4
Exclude: Exclude:
-1
View File
@@ -15,7 +15,6 @@ module Liquid
'?' => :question, '?' => :question,
'-' => :dash, '-' => :dash,
}.freeze }.freeze
IDENTIFIER = /[a-zA-Z_][\w-]*\??/ IDENTIFIER = /[a-zA-Z_][\w-]*\??/
SINGLE_STRING_LITERAL = /'[^\']*'/ SINGLE_STRING_LITERAL = /'[^\']*'/
DOUBLE_STRING_LITERAL = /"[^\"]*"/ DOUBLE_STRING_LITERAL = /"[^\"]*"/
-3
View File
@@ -14,7 +14,6 @@ module Liquid
def consume(type = nil) def consume(type = nil)
token = @tokens[@p] token = @tokens[@p]
if type && token[0] != type if type && token[0] != type
raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}" raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
end end
@@ -27,7 +26,6 @@ module Liquid
# or false otherwise. # or false otherwise.
def consume?(type) def consume?(type)
token = @tokens[@p] token = @tokens[@p]
return false unless token && token[0] == type return false unless token && token[0] == type
@p += 1 @p += 1
token[1] token[1]
@@ -36,7 +34,6 @@ module Liquid
# Like consume? Except for an :id token of a certain name # Like consume? Except for an :id token of a certain name
def id?(str) def id?(str)
token = @tokens[@p] token = @tokens[@p]
return false unless token && token[0] == :id return false unless token && token[0] == :id
return false unless token[1] == str return false unless token[1] == str
@p += 1 @p += 1
+1 -2
View File
@@ -12,14 +12,13 @@ module Liquid
'"' => '"', '"' => '"',
"'" => ''', "'" => ''',
}.freeze }.freeze
HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/ HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/
STRIP_HTML_TAGS = /<.*?>/m
STRIP_HTML_BLOCKS = Regexp.union( STRIP_HTML_BLOCKS = Regexp.union(
%r{<script.*?</script>}m, %r{<script.*?</script>}m,
/<!--.*?-->/m, /<!--.*?-->/m,
%r{<style.*?</style>}m %r{<style.*?</style>}m
) )
STRIP_HTML_TAGS = /<.*?>/m
# Return the size of an array or of an string # Return the size of an array or of an string
def size(input) def size(input)