extended-markdown-filter 0.4.1 → 0.4.2
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 +2 -2
- data/lib/filters/pre/command-line.rb +2 -2
- data/lib/filters/pre/helper.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeeb032d4f301275d574fe745a8cfdaf0e049e32
|
4
|
+
data.tar.gz: 4d115e3caae37b64d097bb480ab7148feca95371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f998853c0185775efff5b31527206cdacde6ee97d1eaf757e701165e11e0122343c4b57dcff030c8dad3eee77362c3e15c85683d2ec147d69965073dfb7bf147
|
7
|
+
data.tar.gz: f211933486f7f99c80754d9bef19368f579cdcf90b36fe2f7acaf14e68208b202c04118ab861f5dd92414c99872c954e47e9be13bf7354a87cfdf8aa772ae9e9
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "extended-markdown-filter"
|
3
|
-
spec.version = "0.4.
|
3
|
+
spec.version = "0.4.2"
|
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}
|
@@ -25,8 +25,8 @@ class ExtendedMarkdownFilter < HTML::Pipeline::MarkdownFilter
|
|
25
25
|
Filters.context = context
|
26
26
|
|
27
27
|
# do preprocessing, then call HTML::Pipeline::Markdown
|
28
|
-
format_command_line
|
29
|
-
format_helper
|
28
|
+
text = format_command_line text
|
29
|
+
text = format_helper text
|
30
30
|
|
31
31
|
super text, context, result
|
32
32
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Filters
|
2
2
|
module PreFilter
|
3
|
-
def format_command_line
|
4
|
-
text.gsub
|
3
|
+
def format_command_line(text)
|
4
|
+
text.gsub /\n?``` command-line(.+?)```/m do |block|
|
5
5
|
block.gsub! /^``` command-line/, '<pre class="command-line">'
|
6
6
|
block.gsub! /^```$/, "</pre>\n"
|
7
7
|
block.gsub!(/^\$ (.+)$/) { %Q|<span class="command">#{$1.rstrip}</span>| }
|
data/lib/filters/pre/helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Filters
|
2
2
|
module PreFilter
|
3
|
-
def format_helper
|
3
|
+
def format_helper(text)
|
4
4
|
prefix = '<p'
|
5
5
|
|
6
|
-
text.gsub
|
6
|
+
text.gsub /\n?``` helper(.+?)```/m do |block|
|
7
7
|
block.gsub! /^``` helper\s*/, ''
|
8
8
|
block.gsub! /^```$/, ''
|
9
9
|
|