Skip to content

Commit 4a8242d

Browse files
committed
Update specs and README, bump version
1 parent a61f206 commit 4a8242d

File tree

9 files changed

+49
-6
lines changed

9 files changed

+49
-6
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ redcarpet 3.4.0 0.0065
5555
- [Install](#install)
5656
- [Usage examples](#usage-examples)
5757
- [Plugins](#plugins)
58+
- [Upgrading](#upgrading)
5859
- [References / Thanks](#references--thanks)
5960
- [License](#license)
6061
@@ -297,6 +298,44 @@ other implementations.
297298
298299
-->
299300

301+
## Upgrading
302+
303+
Upgrading to `8.4.1.2` could cause some small breakage if you are using any custom plugins. The [motion-markdown-it-plugins](https://github.com/digitalmoksha/motion-markdown-it-plugins) plugins have already been upgraded.
304+
305+
#### charCodeAt
306+
307+
Make sure you have
308+
309+
```ruby
310+
include MarkdownIt::Common::Utils
311+
```
312+
313+
at the top of your plugin file. Then change any references to `charCodeAt`. For example,
314+
315+
```ruby
316+
state.src.charCodeAt(pos)
317+
```
318+
319+
would become
320+
321+
```ruby
322+
charCodeAt(state.src, pos)
323+
```
324+
325+
#### slice_to_end
326+
327+
`slice_to_end` has been removed. Change references like this
328+
329+
```ruby
330+
state.src.slice_to_end(pos)
331+
```
332+
333+
to
334+
335+
```ruby
336+
state.src[pos..-1]
337+
```
338+
300339
## References / Thanks
301340

302341
Thanks to the authors of the original implementation in Javascript, [markdown-it](https://github.com/markdown-it/markdown-it):

lib/motion-markdown-it.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
require 'motion-markdown-it/common/utils'
2525
require 'motion-markdown-it/common/html_blocks'
2626
require 'motion-markdown-it/common/html_re'
27-
require 'motion-markdown-it/common/string'
2827
require 'motion-markdown-it/common/simpleidn'
2928
require 'motion-markdown-it/helpers/parse_link_destination'
3029
require 'motion-markdown-it/helpers/parse_link_label'

lib/motion-markdown-it/rules_block/html_block.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module MarkdownIt
44
module RulesBlock
55
class HtmlBlock
6+
extend Common::Utils
67

78
HTML_OPEN_CLOSE_TAG_RE = MarkdownIt::Common::HtmlRe::HTML_OPEN_CLOSE_TAG_RE
89

lib/motion-markdown-it/rules_block/lheading.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module MarkdownIt
44
module RulesBlock
55
class Lheading
6+
extend Common::Utils
67

78
#------------------------------------------------------------------------------
89
def self.lheading(state, startLine, endLine, silent = true)

lib/motion-markdown-it/rules_inline/autolink.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module MarkdownIt
44
module RulesInline
55
class Autolink
6+
extend Common::Utils
67

78
EMAIL_RE = /^<([a-zA-Z0-9.!#$\%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/
89
AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/

lib/motion-markdown-it/rules_inline/backticks.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
module MarkdownIt
44
module RulesInline
55
class Backticks
6+
extend Common::Utils
67

78
#------------------------------------------------------------------------------
89
def self.backtick(state, silent)
910
pos = state.pos
1011
ch = charCodeAt(state.src, pos)
1112

12-
return false if (ch != 0x60) # `
13+
return false if (ch != 0x60) # `
1314

1415
start = pos
1516
pos += 1

lib/motion-markdown-it/rules_inline/html_inline.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Process html tags
22
#------------------------------------------------------------------------------
33
module MarkdownIt
4-
54
module RulesInline
65
class HtmlInline
6+
extend Common::Utils
77
include MarkdownIt::Common::HtmlRe
8-
8+
99
#------------------------------------------------------------------------------
1010
def self.isLetter(ch)
1111
lc = ch | 0x20 # to lower case
@@ -20,7 +20,7 @@ def self.html_inline(state, silent)
2020

2121
# Check start
2222
max = state.posMax
23-
if (charCodeAt(state.src, pos) != 0x3C || pos + 2 >= max) # <
23+
if (charCodeAt(state.src, pos) != 0x3C || pos + 2 >= max) # <
2424
return false
2525
end
2626

lib/motion-markdown-it/rules_inline/text.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
module MarkdownIt
55
module RulesInline
66
class Text
7+
extend Common::Utils
78

89
# Rule to skip pure text
910
# '{}$%@~+=:' reserved for extentions

lib/motion-markdown-it/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module MotionMarkdownIt
22

3-
VERSION = '8.4.1.1'
3+
VERSION = '8.4.1.2'
44

55
end

0 commit comments

Comments
 (0)