octopress-escape-code 2.0.3 → 2.0.4
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/octopress-escape-code.rb +10 -10
- data/lib/octopress-escape-code/version.rb +1 -1
- data/test/_expected/nested-codeblocks.html +11 -0
- data/test/nested-codeblocks.md +17 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9cd2dff39bb81d753dd1148b61c1c98e95f5ce0
|
4
|
+
data.tar.gz: 21b9bc401c836632d65a8ecbfd50037688fa6bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9482fbcdb4ea1b80637abaac324444c44a1770077c88dcb8d8991a212d87e49285a38fc38175a9073f25fa8afa1c453900a15068b900a72c6fcda9915cef16b
|
7
|
+
data.tar.gz: 4447be2b8f732654a54fb96b590ae514c47cdcccfde5a3f877bf14826c22a0e24c34b570f78183f09bbb64f60e443739bacec876a1a2bb679bf0dd185a428fd9
|
data/CHANGELOG.md
CHANGED
@@ -87,6 +87,16 @@ module Octopress
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
+
# Escape codeblock tag contents
|
91
|
+
content = content.gsub /^({%\s*codeblock.+?%})(.+?){%\s*endcodeblock\s*%}/m do
|
92
|
+
"#{$1}{% raw %}#{$2.gsub /{% (end)?raw %}/, ''}{% endraw %}{% endcodeblock %}"
|
93
|
+
end
|
94
|
+
|
95
|
+
# Escape highlight tag contents
|
96
|
+
content = content.gsub /^({%\s*highlight.+?%})(.+?){%\s*endhighlight\s*%}/m do
|
97
|
+
"#{$1}{% raw %}#{$2.gsub(/{% (end)?raw %}/, '')}{% endraw %}{% endhighlight %}"
|
98
|
+
end
|
99
|
+
|
90
100
|
# Escape codefenced codeblocks
|
91
101
|
content = content.gsub /^(`{3}.+?`{3})/m do
|
92
102
|
|
@@ -100,16 +110,6 @@ module Octopress
|
|
100
110
|
"{% raw %}\n#{code}\n{% endraw %}"
|
101
111
|
end
|
102
112
|
|
103
|
-
# Escape codeblock tag contents
|
104
|
-
content = content.gsub /^({%\s*codeblock.+?%})(.+?){%\s*endcodeblock\s*%}/m do
|
105
|
-
"#{$1}{% raw %}#{$2.gsub /{% (end)?raw %}/, ''}{% endraw %}{% endcodeblock %}"
|
106
|
-
end
|
107
|
-
|
108
|
-
# Escape highlight tag contents
|
109
|
-
content = content.gsub /^({%\s*highlight.+?%})(.+?){%\s*endhighlight\s*%}/m do
|
110
|
-
"#{$1}{% raw %}#{$2.gsub(/{% (end)?raw %}/, '')}{% endraw %}{% endhighlight %}"
|
111
|
-
end
|
112
|
-
|
113
113
|
content
|
114
114
|
end
|
115
115
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<p>hey</p>
|
2
|
+
<div class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="p">{</span><span class="o">%</span> <span class="n">codeblock</span> <span class="ss">lang</span><span class="p">:</span><span class="n">ruby</span> <span class="ss">title</span><span class="p">:</span><span class="s2">"Check if a number is</span>
|
3
|
+
<span class="s2">prime"</span> <span class="ss">mark</span><span class="p">:</span><span class="mi">3</span> <span class="sx">%}</span>
|
4
|
+
<span class="sx">class Fixnum</span>
|
5
|
+
<span class="sx"> def prime?</span>
|
6
|
+
<span class="sx"> ('1' * self) !~ /^1?$|^(11+?)\1+$/</span>
|
7
|
+
<span class="sx"> end</span>
|
8
|
+
<span class="sx">end</span>
|
9
|
+
<span class="sx">{% endcodeblock %}</span>
|
10
|
+
</code></pre></div>
|
11
|
+
<p>guys?</p>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-escape-code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
@@ -117,9 +117,11 @@ files:
|
|
117
117
|
- test/_expected/indented-codefence.html
|
118
118
|
- test/_expected/index.html
|
119
119
|
- test/_expected/markdown-table.html
|
120
|
+
- test/_expected/nested-codeblocks.html
|
120
121
|
- test/indented-codefence.md
|
121
122
|
- test/index.md
|
122
123
|
- test/markdown-table.md
|
124
|
+
- test/nested-codeblocks.md
|
123
125
|
homepage: https://github.com/octopress/escape-code
|
124
126
|
licenses:
|
125
127
|
- MIT
|
@@ -150,6 +152,8 @@ test_files:
|
|
150
152
|
- test/_expected/indented-codefence.html
|
151
153
|
- test/_expected/index.html
|
152
154
|
- test/_expected/markdown-table.html
|
155
|
+
- test/_expected/nested-codeblocks.html
|
153
156
|
- test/indented-codefence.md
|
154
157
|
- test/index.md
|
155
158
|
- test/markdown-table.md
|
159
|
+
- test/nested-codeblocks.md
|