vimwiki_markdown 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/changelog.md +3 -0
- data/lib/vimwiki_markdown/version.rb +1 -1
- data/lib/vimwiki_markdown/wiki_body.rb +10 -0
- data/spec/lib/vimwiki_markdown/wiki_body_spec.rb +6 -0
- 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: a2fd707b900cb57f83d9b363ca7ecdfb1ef7bc3c0784b6d837d025506bfb23c9
|
4
|
+
data.tar.gz: 0ab730e8add13342a0d1188d281185c80ec23dbd2b4f7a88fd37953c665b2eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e4bd0e9039a5dd14a1183eba6d1fab3bdf6d184bed9838be0da24be1ccd369c48f00d40fa35085f6355baf259907a1842ed8bfb242ff79152be91f955360615
|
7
|
+
data.tar.gz: 1efbc7939774eaca7b8d6b731a252cf2248da1f9bad622b3c74c567f35eea2572070e006b75d449fe005fefb6b48b1b52593ec8742ad3e60ae57e3b4aa7b1e08
|
data/changelog.md
CHANGED
@@ -11,6 +11,8 @@ class VimwikiMarkdown::WikiBody
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def to_s
|
14
|
+
hack_replace_commonmarker_proc!
|
15
|
+
|
14
16
|
@markdown_body = get_wiki_markdown_contents
|
15
17
|
fixlinks
|
16
18
|
html = GitHub::Markup.render_s(
|
@@ -64,4 +66,12 @@ class VimwikiMarkdown::WikiBody
|
|
64
66
|
VimwikiMarkdown::VimwikiLink.new(match, options.input_file, options.extension, options.root_path).to_s
|
65
67
|
end
|
66
68
|
end
|
69
|
+
|
70
|
+
def hack_replace_commonmarker_proc!
|
71
|
+
GitHub::Markup::Markdown::MARKDOWN_GEMS["commonmarker"] = proc { |content, options: {}|
|
72
|
+
commonmarker_opts = [:GITHUB_PRE_LANG].concat(options.fetch(:commonmarker_opts, []))
|
73
|
+
commonmarker_exts = options.fetch(:commonmarker_exts, [:autolink, :table, :strikethrough])
|
74
|
+
CommonMarker.render_html(content, commonmarker_opts, commonmarker_exts)
|
75
|
+
}
|
76
|
+
end
|
67
77
|
end
|
@@ -39,6 +39,12 @@ module VimwikiMarkdown
|
|
39
39
|
expect(wiki_body.to_s).to include("<p>hello world</p>")
|
40
40
|
end
|
41
41
|
|
42
|
+
it "must convert unsafe html content correctly" do
|
43
|
+
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true)
|
44
|
+
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return('<iframe src="test"></iframe>')
|
45
|
+
expect(wiki_body.to_s).to include('<iframe src="test"></iframe>')
|
46
|
+
end
|
47
|
+
|
42
48
|
it "must convert multiple links on the same line correctly" do
|
43
49
|
allow(wiki_body).to receive(:get_wiki_markdown_contents).and_return("[here](here) [there](there)")
|
44
50
|
allow_any_instance_of(VimwikiMarkdown::VimwikiLink).to receive(:vimwiki_markdown_file_exists?).and_return(true)
|
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.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Davey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|