mdless 2.1.13 → 2.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/mdless/console.rb +10 -4
- data/lib/mdless/string.rb +3 -3
- data/lib/mdless/taskpaper.rb +2 -1
- data/lib/mdless/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c33009eb5144e58388cddecbb739f8ebe3889202b21838a59fa303cdcf33726
|
4
|
+
data.tar.gz: 6adca397f29c120348707c5eb4af99a443b9f737e60262e1f4f779b33d7d68fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb103df693efacc6f20ccbfcb73ad73ed5eda5e75ba1143cb8753a7f0a5a3865226c46c6f6a61a1fdb1a8fd29278c4b34b531e2efa3f773cc2688fe13ce5601
|
7
|
+
data.tar.gz: 4b4178f479b323c7079281ebbc1c531586ceebf04de77cb998c391415fcbb708bec357d1bce7312d42ee7cc67d59dc44c1f6dab2ac55a51c3dcd327cc132bc59
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -227,7 +227,7 @@ $ gather https://brettterpstra.com/projects/gather-cli/ | mdless
|
|
227
227
|
[fzf](https://github.com/junegunn/fzf) is a tool for selecting files and other menu options with typeahead fuzzy matching. You can set up `mdless` as a previewer when selecting Markdown or TaskPaper files.
|
228
228
|
|
229
229
|
```
|
230
|
-
$ ls *.md | fzf --preview 'mdless
|
230
|
+
$ ls *.md | fzf --preview 'mdless {}'
|
231
231
|
```
|
232
232
|
|
233
233
|
### Fish
|
data/lib/mdless/console.rb
CHANGED
@@ -262,10 +262,15 @@ module Redcarpet
|
|
262
262
|
end
|
263
263
|
|
264
264
|
def paragraph(text)
|
265
|
+
text.scrub!
|
265
266
|
out = if MDLess.options[:preserve_linebreaks]
|
266
267
|
"#{xc}#{text.gsub(/ +/, ' ').strip}#{xc}#{x}\n\n"
|
267
268
|
else
|
268
|
-
|
269
|
+
if text.uncolor =~ / {2,}$/ || text.uncolor =~ /^%/
|
270
|
+
"#{xc}#{text.gsub(/ +/, ' ').strip}#{xc}#{x}\n"
|
271
|
+
else
|
272
|
+
"#{xc}#{text.gsub(/ +/, ' ').gsub(/\n+(?![:-])/, ' ').strip}#{xc}#{x}\n\n"
|
273
|
+
end
|
269
274
|
end
|
270
275
|
if MDLess.options[:at_tags] || MDLess.options[:taskpaper]
|
271
276
|
highlight_tags(out)
|
@@ -755,7 +760,7 @@ module Redcarpet
|
|
755
760
|
line = "#{color('metadata marker')}#{'%' * longest}"
|
756
761
|
else
|
757
762
|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
|
758
|
-
line = "#{color('metadata color')}#{line}"
|
763
|
+
line = "#{color('metadata marker')}% #{color('metadata color')}#{line}\n"
|
759
764
|
end
|
760
765
|
|
761
766
|
line += "\u00A0" * (longest - line.uncolor.strip.length) + xc
|
@@ -766,15 +771,16 @@ module Redcarpet
|
|
766
771
|
|
767
772
|
if !in_yaml && first_line =~ /(?i-m)^[\w ]+:\s+\S+/
|
768
773
|
MDLess.log.info('Found MMD Headers')
|
769
|
-
input.sub!(/(?i-m)^([\S ]+:[\s\S]*?)+(?=\n
|
774
|
+
input.sub!(/(?i-m)^([\S ]+:[\s\S]*?)+(?=\n *\n)/) do |mmd|
|
770
775
|
lines = mmd.split(/\n/)
|
771
776
|
return mmd if lines.count > 20
|
772
777
|
|
773
778
|
longest = lines.inject { |memo, word| memo.length > word.length ? memo : word }.length
|
774
779
|
longest = longest < MDLess.cols ? longest + 1 : MDLess.cols
|
780
|
+
|
775
781
|
lines.map do |line|
|
776
782
|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
|
777
|
-
line = "#{color('metadata color')}#{line}"
|
783
|
+
line = "#{color('metadata marker')}%#{color('metadata color')}#{line} "
|
778
784
|
line += "\u00A0" * (longest - line.uncolor.strip.length)
|
779
785
|
line + xc
|
780
786
|
end.join("\n") + "#{"\u00A0" * longest}#{xc}\n"
|
data/lib/mdless/string.rb
CHANGED
@@ -74,7 +74,7 @@ class ::String
|
|
74
74
|
line = "#{color('metadata marker')}#{'%' * longest}"
|
75
75
|
else
|
76
76
|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
|
77
|
-
line = "#{color('metadata color')}#{line}"
|
77
|
+
line = "#{color('metadata color')}#{line}<br>"
|
78
78
|
end
|
79
79
|
|
80
80
|
line += "\u00A0" * (longest - line.uncolor.strip.length) + xc
|
@@ -85,7 +85,7 @@ class ::String
|
|
85
85
|
|
86
86
|
if !in_yaml && first_line =~ /(?i-m)^[\w ]+:\s+\S+/
|
87
87
|
MDLess.log.info('Found MMD Headers')
|
88
|
-
input.sub!(/(?i-m)^([\S ]+:[\s\S]*?)+(?=\n
|
88
|
+
input.sub!(/(?i-m)^([\S ]+:[\s\S]*?)+(?=\n *\n)/) do |mmd|
|
89
89
|
lines = mmd.split(/\n/)
|
90
90
|
return mmd if lines.count > 20
|
91
91
|
|
@@ -93,7 +93,7 @@ class ::String
|
|
93
93
|
longest = longest < @cols ? longest + 1 : @cols
|
94
94
|
lines.map do |line|
|
95
95
|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
|
96
|
-
line = "#{color('metadata color')}#{line}"
|
96
|
+
line = "#{color('metadata color')}#{line}<br>"
|
97
97
|
line += "\u00A0" * (longest - line.uncolor.strip.length)
|
98
98
|
line + xc
|
99
99
|
end.join("\n") + "#{"\u00A0" * longest}#{xc}\n"
|
data/lib/mdless/taskpaper.rb
CHANGED
@@ -61,9 +61,10 @@ module CLIMarkdown
|
|
61
61
|
if tasks >= 6
|
62
62
|
return true
|
63
63
|
else
|
64
|
-
tst = remove_meta(input)
|
64
|
+
tst = remove_meta(input.dup)
|
65
65
|
tst = tst.gsub(PROJECT_RX, '')
|
66
66
|
tst = tst.gsub(TASK_RX, '')
|
67
|
+
tst = tst.gsub(NOTE_RX, '')
|
67
68
|
tst = tst.gsub(/^ *\n$/, '')
|
68
69
|
return tst.strip.length == 0
|
69
70
|
end
|
data/lib/mdless/version.rb
CHANGED