vimwiki_markdown 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +4 -0
- data/lib/vimwiki_markdown/version.rb +1 -1
- data/lib/vimwiki_markdown/vimwiki_toc_filter.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9f4165d6c964688b29b13f05378ad2d7f8aa04621121e718e3bf25a9832ecc
|
4
|
+
data.tar.gz: d76fa5a6a5081ff3cde0e8d556bca8e45e90f25618ad4b623e0949c88ed18e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909ccbcc5420b3da2b2c62d40bf5e6f8223afdd2044386f33809598d741cb19ae197d728f22bff724fd99c2d109feb917fc862287a61ab22004ee50486b0ce93
|
7
|
+
data.tar.gz: 1ed5e03a0811ce63df21004ae8f10020a6d8fd758280d6cc0e6dca353ab49431190cf9f23d9ff230713e9285cf69231d314a7bfcd7fa8e681e889d2ba6b634af
|
data/changelog.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "cgi"
|
2
|
+
|
1
3
|
class VimwikiTOCFilter < HTML::Pipeline::TableOfContentsFilter
|
2
4
|
def call
|
3
5
|
result[:toc] = String.new('')
|
@@ -12,7 +14,7 @@ class VimwikiTOCFilter < HTML::Pipeline::TableOfContentsFilter
|
|
12
14
|
uniq = headers[id] > 1 ? "-#{headers[id]}" : ''
|
13
15
|
headers[id] += 1
|
14
16
|
if header_content = node.children.first
|
15
|
-
result[:toc] << %(<li><a href="##{id}#{uniq}">#{
|
17
|
+
result[:toc] << %(<li><a href="##{id}#{uniq}">#{CGI.escape_html(text)}</a></li>\n)
|
16
18
|
header_content.add_previous_sibling(%(<a id="#{id}#{uniq}" class="anchor" href="##{id}#{uniq}" aria-hidden="true">#{anchor_icon}</a>))
|
17
19
|
end
|
18
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimwiki_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Davey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|