mdless 0.0.7 → 0.0.8
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 +3 -6
- data/lib/mdless/tables.rb +4 -5
- data/lib/mdless/version.rb +1 -1
- 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: 8c90942cd09b87938acb76039218272c24cfe259
|
4
|
+
data.tar.gz: 910c0cf283c54a502329e867d161635a6ea6b9e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bd405018da73047f82adbf0e1931a05a84baf598cc3cfe68911bb5fb3cbe7c2c41ead289d3c307f38bd3c6daf3de691a40cfcdb3f32e24a4f56eb0a97813fc5
|
7
|
+
data.tar.gz: d22e8c3e662d02d5d6f5b7ed2bc44d6aa79d2c04598c90b7ad2844cb8e425cada82c1cdc34f8b295e5b3b9fc6a2fd13ac3dfefc83376754ffcdce56c197da6bc
|
data/lib/mdless/converter.rb
CHANGED
@@ -236,7 +236,7 @@ module CLIMarkdown
|
|
236
236
|
|
237
237
|
table = this_table.join("\n").strip
|
238
238
|
begin
|
239
|
-
formatted =
|
239
|
+
formatted = MDTableCleanup.new(table)
|
240
240
|
res = formatted.to_md
|
241
241
|
res = color_table(res)
|
242
242
|
rescue
|
@@ -257,10 +257,6 @@ module CLIMarkdown
|
|
257
257
|
all_content.join("\n")
|
258
258
|
end
|
259
259
|
|
260
|
-
def clean_table(input)
|
261
|
-
|
262
|
-
end
|
263
|
-
|
264
260
|
def clean_markers(input)
|
265
261
|
input.gsub!(/^(\e\[[\d;]+m)?[%~] ?/,'\1')
|
266
262
|
input
|
@@ -590,7 +586,8 @@ module CLIMarkdown
|
|
590
586
|
end
|
591
587
|
|
592
588
|
# list items
|
593
|
-
|
589
|
+
# TODO: Fix ordered list numbering, pad numbers based on total number of list items
|
590
|
+
line.gsub!(/^(\s*)([*\-+]|\d+\.) /) do |m|
|
594
591
|
match = Regexp.last_match
|
595
592
|
last = find_color(match.pre_match)
|
596
593
|
indent = match[1] || ''
|
data/lib/mdless/tables.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
module CLIMarkdown
|
2
|
-
class
|
2
|
+
class MDTableCleanup
|
3
3
|
|
4
|
-
def initialize(
|
5
|
-
@
|
4
|
+
def initialize(input)
|
5
|
+
@string = input
|
6
6
|
@format_row = []
|
7
|
-
parse
|
8
7
|
end
|
9
8
|
|
10
9
|
def parse
|
11
10
|
@table = []
|
12
11
|
format = []
|
13
12
|
cols = 0
|
14
|
-
rows = @
|
13
|
+
rows = @string.split(/\r?\n/)
|
15
14
|
rows.each do |row|
|
16
15
|
row.strip!
|
17
16
|
row.sub!(/^\s*\|?/,'').sub!(/\|?\s*$/,'')
|
data/lib/mdless/version.rb
CHANGED