Skip to content

Commit

Permalink
fix for taskpaper metadata
Browse files Browse the repository at this point in the history
- FIXED: TaskPaper file with metadata causing negative argument error
  • Loading branch information
ttscoff committed Dec 4, 2023
1 parent 306e270 commit 3658bf2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mdless/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def color_meta(cols)
line = "#{color('metadata color')}#{line}<br>"
end

line += "\u00A0" * (longest - line.uncolor.strip.length) + xc
line
line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
line + xc
end.join("\n") + "#{xc}\n"
end
end
Expand All @@ -93,8 +93,8 @@ def color_meta(cols)
longest = longest < @cols ? longest + 1 : @cols
lines.map do |line|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
line = "#{color('metadata color')}#{line}<br>"
line += "\u00A0" * (longest - line.uncolor.strip.length)
line = "#{color('metadata color')}#{line}"
line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
line + xc
end.join("\n") + "#{"\u00A0" * longest}#{xc}\n"
end
Expand Down

0 comments on commit 3658bf2

Please sign in to comment.