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: 17006c32064c699e7fdc6a64370c7391afda3be5
4
- data.tar.gz: 59bdd2f17cc6b586e9cb41ffad7b3cf86e1e458e
3
+ metadata.gz: 0d671254ae8cb6c47ccb878ef7fb4b936f5a27e2
4
+ data.tar.gz: aeea8f67c105d2fe0822665bd47f76dd0fb56419
5
5
  SHA512:
6
- metadata.gz: fab84a1a5da7af3dfc6da99e38c25acb0f75439b7005c6da3ca31b89e5a4b74e529abf14c5e330dcacf4d6fedd6d238c73f929ce7b585ac5ba763a825d63d0a4
7
- data.tar.gz: 953045b6fb152017d8710c15ff400a97f622c7455f85c6a51ef1b2a6fb02d7a32456fd90e517f2f5331f03a2cb1a98c52d6d2550b1f03f1ac7843543787552d6
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
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module NumberedHeadings
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
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.0
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-24 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler