mdless 2.1.12 → 2.1.14
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 +9 -0
- data/README.md +2 -2
- data/lib/mdless/console.rb +11 -6
- 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: ffc20d85c54af629a9fe7b40cb2d070f4b1747cc83a11c8db247dd41552b3fc7
         | 
| 4 | 
            +
              data.tar.gz: 724e9dd1be0e95b076d4d33a166a06096f25295c60c91209c90a1d3e75010b0e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d82b111bdd9266f47d96c56fc5aa3475e29aa2a9076fb25fcaf035f86da4f72cdd91d7ee99b77fef10dcd945ef01cd98caaa7ff29e074d77a9f6fca28ebc81f4
         | 
| 7 | 
            +
              data.tar.gz: 8d645cf69412688a8b2e4d370442bbd230c4bb22ee40b73b8d3bdb8e6648bdf804c399ff59607018c5b8dec34a1a11a5c54e12fc1825380c496bbed430f52cd9
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,4 +1,13 @@ | |
| 1 | 
            +
            2.1.14
         | 
| 2 | 
            +
            : Spaces on a line separating metadata won't break display
         | 
| 3 | 
            +
            : Preserve line breaks in metadata
         | 
| 4 | 
            +
            : Failure to display metadata fixed
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            2.1.13
         | 
| 7 | 
            +
            : Remove debugging statement
         | 
| 8 | 
            +
             | 
| 1 9 | 
             
            2.1.12
         | 
| 10 | 
            +
            : Fix list indentation when nesting
         | 
| 2 11 |  | 
| 3 12 | 
             
            2.1.11
         | 
| 4 13 | 
             
            : Better regex for highlighting raw HTML
         | 
    
        data/README.md
    CHANGED
    
    | @@ -147,7 +147,7 @@ You can also use 3 or 6-digit hex codes in place of color names. These can be pr | |
| 147 147 |  | 
| 148 148 | 
             
            Some extra (non-color) settings are available for certain keys, e.g. `pad_char` to define the right padding character used on level 1 and 2 headlines. Note that you can change the [Pygments](http://pygments.org/) theme used for syntax highlighting with the code_block.pygments_theme setting. For a list of available styles (assuming you have Pygments installed), use `pygmentize -L styles`.
         | 
| 149 149 |  | 
| 150 | 
            -
            The display of characters around emphasis and code spans can be configured. By default, the surrounding character for bold is `**`, italic is `_`, and code span is  | 
| 150 | 
            +
            The display of characters around emphasis and code spans can be configured. By default, the surrounding character for bold is `**`, italic is `_`, and code span is a backtick. You can leave these keys empty to not display characters at all. For triple-emphasized text, the text will be surrounded by italic and bold characters, in that order.
         | 
| 151 151 |  | 
| 152 152 | 
             
            ```yaml
         | 
| 153 153 | 
             
            emphasis:
         | 
| @@ -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)
         | 
| @@ -602,7 +607,7 @@ module Redcarpet | |
| 602 607 | 
             
                  def indent_lines(input, spaces)
         | 
| 603 608 | 
             
                    return nil if input.nil?
         | 
| 604 609 |  | 
| 605 | 
            -
                    indent = spaces.scan( | 
| 610 | 
            +
                    indent = spaces.scan(/ /).count
         | 
| 606 611 |  | 
| 607 612 | 
             
                    lines = input.split(/\n/)
         | 
| 608 613 | 
             
                    line1 = lines.shift
         | 
| @@ -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"
         | 
| @@ -1073,7 +1079,6 @@ module Redcarpet | |
| 1073 1079 | 
             
                    input = reference_links(input) if MDLess.options[:links] == :reference || MDLess.options[:links] == :paragraph
         | 
| 1074 1080 | 
             
                    # lists
         | 
| 1075 1081 | 
             
                    input = fix_lists(input)
         | 
| 1076 | 
            -
                    puts input
         | 
| 1077 1082 | 
             
                    fix_colors(input)
         | 
| 1078 1083 | 
             
                  end
         | 
| 1079 1084 | 
             
                end
         | 
    
        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