middleman-vegas 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/middleman-vegas/markdown_parser.rb +8 -5
- data/lib/middleman-vegas/version.rb +1 -1
- 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: '0669079980e36265ac0a4732961fb1ccbfb55e23'
|
4
|
+
data.tar.gz: 8af493e045a3f666f308df80f23c6b28c6bc605b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da349e7f24869adea45066fae848cb79db4e1834aa50d4dfbc8cf8baf63775fc0e6e0ef2151f450e98bf718316f2ff929a0dbdbe49fcf19e1f022a90d0bb5db8
|
7
|
+
data.tar.gz: 8d478f12e9f05bbb91dfba78b588adfe0cb2ad0a961756007f8f34feeff38bd078919cc649ec71372536dae43083aec3e94928c65ae7da0a43811f4306de9352
|
@@ -9,7 +9,7 @@ module Middleman
|
|
9
9
|
# CODE
|
10
10
|
# ```
|
11
11
|
def self.parse_document(full_document)
|
12
|
-
full_document.gsub
|
12
|
+
full_document.gsub /^\s{0,4}`{3}.+?`{3}/m do |code_block|
|
13
13
|
parse_code_block code_block
|
14
14
|
end
|
15
15
|
end
|
@@ -21,10 +21,13 @@ module Middleman
|
|
21
21
|
# ```
|
22
22
|
#
|
23
23
|
def self.parse_code_block(code_block)
|
24
|
-
code_block.gsub
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
code_block.gsub /(\s{0,4})`{3}([^\n]+)?\n(.+?)`{3}\Z/m do
|
25
|
+
spacing = Regexp.last_match(1)
|
26
|
+
spacing = (spacing == "\n" ? "" : spacing)
|
27
|
+
metadata = get_metadata(Regexp.last_match(2).to_s)
|
28
|
+
code = Regexp.last_match(3).to_s
|
29
|
+
trimmed_code = code.gsub("\n#{spacing}","\n")[spacing.length..-1]
|
30
|
+
"#{spacing}#{::Middleman::Vegas::Highlighter.highlight(trimmed_code, metadata)}"
|
28
31
|
end
|
29
32
|
end
|
30
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-vegas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Webber
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|