extended-markdown-filter 0.3.6 → 0.3.7
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/extended-markdown-filter.gemspec +1 -1
- data/lib/extended-markdown-filter.rb +6 -0
- data/lib/jekyll-override.rb +15 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5200188fe9d4b095aa94f5f19e4eb08a391fc18
|
4
|
+
data.tar.gz: daec275fb2ae5afd8d68fdbbc202a8cadf295c3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd1669f41d01f2e74a6a5613e66a2c1f604f3abccdaad70fa001b1263e23899a77cefbbf4a132f5effb59bec199c7dd991988ea723c3364e616c9dbc6c34714b
|
7
|
+
data.tar.gz: d0b94f8baa1b9c915f28b091788191732ab7fc33d9c1eafb35282039b09aaa77d63546ffed66cb6b9ef0bb9ab201aad93ab9ed931d849d6b7c15fbcaf6804b04
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "extended-markdown-filter"
|
3
|
-
spec.version = "0.3.
|
3
|
+
spec.version = "0.3.7"
|
4
4
|
spec.authors = ["Garen Torikian"]
|
5
5
|
spec.email = ["gjtorikian@gmail.com"]
|
6
6
|
spec.summary = %q{Add extended markup syntax to the HTML::Pipeline}
|
@@ -35,6 +35,7 @@ class ExtendedMarkdownFilter < HTML::Pipeline::MarkdownFilter
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.convert_curly_to_bracket(text)
|
38
|
+
return text if text.nil?
|
38
39
|
text = text.gsub(/\{\{\s*#(#{EMF_CURLY_TAGS})\s*\}\}/, '[[#\1]]')
|
39
40
|
text = text.gsub(/\{\{\s*\/(#{EMF_CURLY_TAGS})\s*\}\}/, '[[/\1]]')
|
40
41
|
text = text.gsub(/\{\{\s*(octicon-\S+\s*[^\}]+)\s*\}\}/, '[[\1]]')
|
@@ -42,6 +43,11 @@ class ExtendedMarkdownFilter < HTML::Pipeline::MarkdownFilter
|
|
42
43
|
text
|
43
44
|
end
|
44
45
|
|
46
|
+
def self.should_jekyll_replace?(site)
|
47
|
+
html_pipeline_context = site.site_payload["site"]["html_pipeline"] && site.site_payload["site"]["html_pipeline"]["context"]
|
48
|
+
site.site_payload["site"]["markdown"] == "HTMLPipeline" && html_pipeline_context && site.site_payload["site"]["html_pipeline"]["context"][:emf_use_blocks]
|
49
|
+
end
|
50
|
+
|
45
51
|
def call
|
46
52
|
# initialize HTML::Pipeline::Markdown, then do post-processing
|
47
53
|
html = super
|
data/lib/jekyll-override.rb
CHANGED
@@ -6,11 +6,24 @@ module Jekyll
|
|
6
6
|
alias_method :old_run, :run
|
7
7
|
|
8
8
|
def run
|
9
|
-
|
10
|
-
if site.site_payload["site"]["markdown"] == "HTMLPipeline" && html_pipeline_context && site.site_payload["site"]["html_pipeline"]["context"][:emf_use_blocks]
|
9
|
+
if ExtendedMarkdownFilter.should_jekyll_replace?(site)
|
11
10
|
document.content = ExtendedMarkdownFilter.convert_curly_to_bracket(document.content)
|
12
11
|
end
|
13
12
|
old_run
|
14
13
|
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Jekyll
|
19
|
+
class Page
|
20
|
+
alias_method :old_render, :render
|
21
|
+
|
22
|
+
def render(layouts, site_payload)
|
23
|
+
if ExtendedMarkdownFilter.should_jekyll_replace?(site)
|
24
|
+
self.content = ExtendedMarkdownFilter.convert_curly_to_bracket(content)
|
25
|
+
end
|
26
|
+
old_render(layouts, site_payload)
|
27
|
+
end
|
15
28
|
end
|
16
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extended-markdown-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-pipeline
|