markly 0.4.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: 770b81ed57426a591eaa4335ad913df94f61017e08f5e19872766e59ec3d33db
4
- data.tar.gz: 45f5295c1fae1747c841a85b8f17f1442d47ad91194a38874e1313e8c95313f4
3
+ metadata.gz: 382ef4ee5a2e69398268595c59f914fc694c1fa0e450b7ba2f74a6ef06d17ede
4
+ data.tar.gz: 5d7119359d1f485980ac4ba9736384f0c67ac0002133021fccf3aa81896ef46e
5
5
  SHA512:
6
- metadata.gz: 75bdb5b83d6ca7685fb659d27f45bfaaefe1241f306ec21281bbbd5906612663c8e4ba7ad3abf59069ff6501c72933c6770d09176dd119de946e5baea0b826ff
7
- data.tar.gz: 0c0aa153efcbbb7914a805e52bf80fdda4bdc5d1ddb0352f7bb00c334f2730d8cd342a19fa273082c07597c16166c666b8f86be66a197729f902e0539903af8f
6
+ metadata.gz: 9b941bb485e19ed83aa4268e5586f39fdc4919e9dc6362dd729980b698a5f35e26299a742382e6055ee644d297393c0c1e95ef8cac5003765beb9ff47f1dc384
7
+ data.tar.gz: 356b61f0db0b4c0fa57d2cca31943264daaad9c31ed2bc5a04d7cdebf0fa27d863215c1ae1a48372d5ccc1b9a52a287ad8fee3657a778667d76cb3bf37592dff
@@ -8,11 +8,14 @@ module Markly
8
8
  super(**options)
9
9
 
10
10
  @ids = ids
11
+ @section = nil
11
12
  end
12
13
 
13
14
  def document(_)
15
+ @section = false
14
16
  super
15
17
  out("</ol>\n</section>\n") if @written_footnote_ix
18
+ out("</section>") if @section
16
19
  end
17
20
 
18
21
  def id_for(node)
@@ -25,7 +28,10 @@ module Markly
25
28
 
26
29
  def header(node)
27
30
  block do
28
- out('<h', node.header_level, "#{id_for(node)}#{source_position(node)}>", :children,
31
+ out('</section>') if @section
32
+ @section = true
33
+ out("<section #{id_for(node)}>")
34
+ out('<h', node.header_level, "#{source_position(node)}>", :children,
29
35
  '</h', node.header_level, '>')
30
36
  end
31
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markly
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian