jekyll-numbered-headings 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d671254ae8cb6c47ccb878ef7fb4b936f5a27e2
|
4
|
+
data.tar.gz: aeea8f67c105d2fe0822665bd47f76dd0fb56419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a746b5148cd221831c544a1bf9ed2652004580137e4a2d9f3ab2d8578deb4421c4c03ef40f7e71e8eb2bd4d78685938fb87fb97897bc4a4ce82deff80b5a0691
|
7
|
+
data.tar.gz: bd222b4cdc14b29889055915b719bf952d4e49de2ee506ee2972a6159c4c16ee96921e268175ad89386b894a07bb6eae21e39fa84a147d51879efdff9e1211e2
|
@@ -1,8 +1,12 @@
|
|
1
1
|
Jekyll::Hooks.register [:pages, :posts, :documents], :pre_render do |article|
|
2
2
|
max_level = 6
|
3
3
|
levels = Array.new(max_level, 0)
|
4
|
+
in_code_block = false
|
4
5
|
|
5
6
|
converted_lines = article.content.split("\n").map do |line|
|
7
|
+
in_code_block = !in_code_block if line.match(/^```/)
|
8
|
+
next line if in_code_block
|
9
|
+
|
6
10
|
matched = line.match(/^(#+)1\. (.+)/)
|
7
11
|
next line unless matched
|
8
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-numbered-headings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- muratayusuke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|