mdless 2.1.65 → 2.1.67

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05ec922e3d766c2ba7ba1e89f427e57666e1fedbe965e97448f96a727292459e
4
- data.tar.gz: 84b81ddd4cf08c34bf96db99b768afe81f4c7d10859164af991720ede8c2ab51
3
+ metadata.gz: 72e973e5e11163c97ba3389291d4820666f6900e3e78cbfe566b82d0c9ae82c0
4
+ data.tar.gz: 18fd8e0f2f476b5404d318a36f75031c6ac7eb8158a414386a38bc43de43668c
5
5
  SHA512:
6
- metadata.gz: 35453ae25117eb919ee039fd479951e8435108188a60eb0f8d4ae5d010b1c713808a8e247bae4212f3ea5ec9e47b34f2826ee90b1e576c676b9be21bb38e19a2
7
- data.tar.gz: 56525e3d80217a08dac2f26d5e6eeb763dd14eeed7f92f60016c1482b58419bb29d988460d4df49b324f2c2aad5cfb837362080a0cf93161960023fcb817b4db
6
+ metadata.gz: a753781c56e52ea216125796f8386586d3797c7864d853ed3f2500cb879c1c15b4365d6533e7b48f21059aa26421c9ff3b52e1aca8550dd0c9832d31de24471f
7
+ data.tar.gz: 4b14eb66dafd52a0ef6549a96bd66dfe0438939a7e02dee6daffd5eb4b861e963bbd34ef5feee4e649bc456f72b0bf87e586966c0f37d5f8ee6048c5d824e02e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ 2.1.66
2
+
3
+ 2.1.65
4
+ : add nbsp_padding flag to toggle Non breaking space characters as right-padding
5
+ : for code blocks.
6
+
7
+ 2.1.64
8
+
9
+ 2.1.63
10
+ : Missing logger in Ruby 4.0.1, added to gemspec
11
+
1
12
  2.1.60
2
13
 
3
14
  2.1.61
@@ -244,10 +255,3 @@
244
255
  : Better language detection for code blocks
245
256
  : when available, use italic font for italics and bold-italics emphasis
246
257
  : new colorization for html tags
247
-
248
- 2.1.63
249
- : Missing logger in Ruby 4.0.1, added to gemspec
250
-
251
- 2.1.64
252
-
253
- 2.1.65
@@ -59,10 +59,16 @@ module Redcarpet
59
59
  end
60
60
 
61
61
  def code_bg(input, width)
62
+ # NOTE: trailing reset is `xc` (\e[0;37m), not bare `x` (\e[0m).
63
+ # clean_escapes in converter.rb strips every bare \e[0m from the final
64
+ # output, so a bare-reset trailer would leak the code-block bg into the
65
+ # rest of the line (terminals with bce extend bg to the right edge).
66
+ # \e[0;37m embeds the same `0` reset parameter alongside a fg set, so
67
+ # it survives clean_escapes and still clears the bg before the newline.
62
68
  pad_char = MDLess.options[:nbsp_padding] ? "\u00A0" : ' '
63
69
  input.split(/\n/).map do |line|
64
70
  tail = line.uncolor.length < width ? pad_char * (width - line.uncolor.length) : ''
65
- "#{x}#{line}#{tail}#{x}"
71
+ "#{x}#{line}#{tail}#{xc}"
66
72
  end.join("\n")
67
73
  end
68
74
 
@@ -556,6 +556,14 @@ module CLIMarkdown
556
556
  end.join("\n")
557
557
  end
558
558
 
559
+ def reset_terminal
560
+ return unless MDLess.options[:color]
561
+
562
+ # less -r leaves SGR attributes active on the terminal when the last
563
+ # visible line is colored; reset the real stdout after the pager exits.
564
+ $stdout.print "\e[0m"
565
+ end
566
+
559
567
  def page(text, &callback)
560
568
  read_io, write_io = IO.pipe
561
569
 
@@ -617,6 +625,7 @@ module CLIMarkdown
617
625
 
618
626
  if MDLess.options[:pager]
619
627
  page(out)
628
+ reset_terminal
620
629
  else
621
630
  $stdout.print out.rstrip
622
631
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.65'
4
+ VERSION = '2.1.67'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.65
4
+ version: 2.1.67
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-05-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: redcarpet
@@ -164,7 +163,6 @@ homepage: http://brettterpstra.com/project/mdless/
164
163
  licenses:
165
164
  - MIT
166
165
  metadata: {}
167
- post_install_message:
168
166
  rdoc_options:
169
167
  - "--title"
170
168
  - mdless
@@ -187,8 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
185
  - !ruby/object:Gem::Version
188
186
  version: '0'
189
187
  requirements: []
190
- rubygems_version: 3.0.3.1
191
- signing_key:
188
+ rubygems_version: 4.0.6
192
189
  specification_version: 4
193
190
  summary: A pager like less, but for Markdown files
194
191
  test_files: []