mdless 1.0.33 → 1.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mdless/converter.rb +8 -8
- data/lib/mdless/version.rb +1 -1
- 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: 6dce520c83c9816d3124e96eefd5f76af0fdb7f1b98515d1b1cbe2dd602fa34e
|
4
|
+
data.tar.gz: fa054888f473b9cab79cdd4446d39092d0e947f20e4feecccc07ff47ab55fc55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e932ba8df8b972fb44d99e6e834abf8068c3c419c7f174b4ca29075dc5d03ab186a8fb5fdf3ff2d4e4ba8679db8f5f493761ebfd4d89f3192f009dcf262aae86
|
7
|
+
data.tar.gz: a2862dcbb7c98960b115afa053b9585e0094489e531ca6daebbf0ce961b36e4f933170ba0ed42329c3cf779e6bcafd00436e765380bfc87a47579564d6001f48
|
data/lib/mdless/converter.rb
CHANGED
@@ -626,23 +626,23 @@ module CLIMarkdown
|
|
626
626
|
input.gsub!(/(?i-m)(^[ \t]*[`~]{3,})([\s\S]*?)\n([\s\S]*?)\1/m) do
|
627
627
|
language = nil
|
628
628
|
m = Regexp.last_match
|
629
|
-
first_indent = m[1].gsub(/\t/,' ').match(/^ */)[0].size
|
629
|
+
first_indent = m[1].gsub(/\t/, ' ').match(/^ */)[0].size
|
630
630
|
|
631
|
-
if m[2] && m[2].strip.
|
631
|
+
if m[2] && !m[2].strip.empty?
|
632
632
|
language = m[2].strip.split(/ /)[0]
|
633
|
-
code_block = pad_max(m[3].to_s,'')
|
634
|
-
leader = language
|
633
|
+
code_block = pad_max(m[3].to_s, '')
|
634
|
+
leader = language || 'code'
|
635
635
|
else
|
636
636
|
first_line = m[3].to_s.split(/\n/)[0]
|
637
637
|
|
638
|
-
if first_line =~
|
639
|
-
shebang = first_line.match(
|
638
|
+
if first_line =~ %r{^\s*#!.*/.+}
|
639
|
+
shebang = first_line.match(%r{^\s*#!.*/(?:env )?([^/]+)$})
|
640
640
|
language = shebang[1]
|
641
641
|
code_block = m[3]
|
642
|
-
leader = shebang[1]
|
642
|
+
leader = shebang[1] || 'code'
|
643
643
|
else
|
644
644
|
code_block = pad_max(m[3].to_s, "#{color('code_block eol')}¬")
|
645
|
-
leader = language
|
645
|
+
leader = language || 'code'
|
646
646
|
end
|
647
647
|
end
|
648
648
|
leader += xc
|
data/lib/mdless/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|