Skip to content

Commit b85b6b1

Browse files
committed
Use new version of charCodeAt
1 parent 4ba070d commit b85b6b1

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

lib/motion-markdown-it-plugins/abbr/abbr.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def self.abbr_def(state, startLine, endLine, silent)
2929
max = state.eMarks[startLine]
3030

3131
return false if (pos + 2 >= max)
32-
return false if (state.src.charCodeAt(pos) != 0x2A) # '*'
32+
return false if charCodeAt(state.src, pos) != 0x2A # '*'
3333
pos += 1
34-
return false if (state.src.charCodeAt(pos) != 0x5B) # '['
34+
return false if charCodeAt(state.src, pos) != 0x5B # '['
3535
pos += 1
3636

3737
labelStart = pos
3838

3939
while pos < max
40-
ch = state.src.charCodeAt(pos)
40+
ch = charCodeAt(state.src, pos)
4141
if (ch == 0x5B) # '['
4242
return false
4343
elsif (ch == 0x5D) # ']'
@@ -49,7 +49,7 @@ def self.abbr_def(state, startLine, endLine, silent)
4949
pos += 1
5050
end
5151

52-
return false if (labelEnd.nil? || state.src.charCodeAt(labelEnd + 1) != 0x3A) # ':'
52+
return false if (labelEnd.nil? || charCodeAt(state.src, labelEnd + 1) != 0x3A) # ':'
5353
return true if (silent)
5454

5555
label = state.src.slice(labelStart...labelEnd).gsub(/\\(.)/, '\1')

lib/motion-markdown-it-plugins/container/container.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(md, name, options)
2626
@name = name
2727
@min_markers = 3
2828
@marker_str = @options[:marker] || ':'
29-
@marker_char = @marker_str.charCodeAt(0)
29+
@marker_char = charCodeAt(@marker_str, 0)
3030
@marker_len = @marker_str.length
3131
@validate = @options[:validate] || lambda {|params| validateDefault(params) }
3232
@render = @options[:render] || lambda {|tokens, idx, _options, env, renderer| renderDefault(tokens, idx, _options, env, renderer) }
@@ -56,7 +56,7 @@ def container(state, startLine, endLine, silent)
5656

5757
# Check out the first character quickly,
5858
# this should filter out most of non-containers
59-
return false if (@marker_char != state.src.charCodeAt(start))
59+
return false if (@marker_char != charCodeAt(state.src, start))
6060

6161
# Check out the rest of the marker string
6262
pos = start + 1
@@ -98,7 +98,7 @@ def container(state, startLine, endLine, silent)
9898
break
9999
end
100100

101-
next if (@marker_char != state.src.charCodeAt(start))
101+
next if (@marker_char != charCodeAt(state.src, start))
102102

103103
if (state.sCount[nextLine] - state.blkIndent >= 4)
104104
# closing fence should be indented less than 4 spaces

lib/motion-markdown-it-plugins/deflist/deflist.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def self.skipMarker(state, line)
2424
return -1 if (start >= max)
2525

2626
# Check bullet
27-
marker = state.src.charCodeAt(start)
27+
marker = charCodeAt(state.src, start)
2828
start += 1
2929
return -1 if (marker != 0x7E && marker != 0x3A) # '~' ':'
3030

@@ -117,7 +117,7 @@ def self.deflist(state, startLine, endLine, silent)
117117
offset = state.sCount[ddLine] + contentStart - (state.bMarks[ddLine] + state.tShift[ddLine])
118118

119119
while pos < max
120-
ch = state.src.charCodeAt(pos)
120+
ch = charCodeAt(state.src, pos)
121121

122122
if isSpace(ch)
123123
if ch == 0x09

lib/motion-markdown-it-plugins/ins/ins.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.init_plugin(md)
1515
#
1616
def self.tokenize(state, silent)
1717
start = state.pos
18-
marker = state.src.charCodeAt(start)
18+
marker = charCodeAt(state.src, start)
1919

2020
return false if silent
2121

lib/motion-markdown-it-plugins/mark/mark.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.init_plugin(md)
1515
#------------------------------------------------------------------------------
1616
def self.tokenize(state, silent)
1717
start = state.pos
18-
marker = state.src.charCodeAt(start)
18+
marker = charCodeAt(state.src, start)
1919

2020
return false if silent
2121

lib/motion-markdown-it-plugins/sub/sub.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def self.subscript(state, silent)
2020
max = state.posMax
2121
start = state.pos
2222

23-
return false if (state.src.charCodeAt(start) != 0x7E) # '~'
23+
return false if charCodeAt(state.src, start) != 0x7E # '~'
2424
return false if (silent) # don't run any pairs in validation mode
2525
return false if (start + 2 >= max)
2626

2727
state.pos = start + 1
2828

2929
while (state.pos < max)
30-
if (state.src.charCodeAt(state.pos) == 0x7E) # '~'
30+
if charCodeAt(state.src, state.pos) == 0x7E # '~'
3131
found = true
3232
break
3333
end

lib/motion-markdown-it-plugins/sup/sup.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def self.superscript(state, silent)
2020
max = state.posMax
2121
start = state.pos
2222

23-
return false if (state.src.charCodeAt(start) != 0x5E) # '^'
23+
return false if charCodeAt(state.src, start) != 0x5E # '^'
2424
return false if (silent) # don't run any pairs in validation mode
2525
return false if (start + 2 >= max)
2626

2727
state.pos = start + 1
2828

2929
while (state.pos < max)
30-
if (state.src.charCodeAt(state.pos) == 0x5E) # '^'
30+
if charCodeAt(state.src, state.pos) == 0x5E # '^'
3131
found = true
3232
break
3333
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module MotionMarkdownItPlugins
22

3-
VERSION = '8.4.2'
3+
VERSION = '8.4.2.1'
44

55
end

motion-markdown-it-plugins.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
1616

1717
gem.require_paths = ["lib"]
1818

19-
gem.add_dependency 'motion-markdown-it', '~> 8.4'
19+
gem.add_dependency 'motion-markdown-it', '> 8.4.1.1'
2020

2121
gem.add_development_dependency 'bacon-expect', '~> 1.0' # required for Travis build to work
2222
end

0 commit comments

Comments
 (0)