mdless 2.1.66 → 2.1.68

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: 10e5cba01868258962b2953db75108db724dafda91d83363aff726fbae1056e2
4
- data.tar.gz: 781055ed8f03a4f62403a26cd3dde900b6babd4c3fc132544b01d9f81d95119a
3
+ metadata.gz: b736fda9420269317f44d74a9e864d817c7648285119626ac5ff15095a4a84d8
4
+ data.tar.gz: f498ce262b93a142782afc6df250603ef6635f939ba04b6a258dcfe2c38ce4da
5
5
  SHA512:
6
- metadata.gz: 9ba9480f94b687bcb8cd766ae606ae1938105b8b28171e4f39163cf2e6afccfd9cf850eecb908190b67e447828eeb29f7340ee080770614f56e7e44d53d4f1ab
7
- data.tar.gz: aef9b191cf2f5bc86c0f478a9b9b19e7e5746f8c44478664febfef10bdb0aa4487cd78cfcaaba90beb840f3d91c47c4c8a47fa84f5beb29beb46b60d91a1d03c
6
+ metadata.gz: c9e4488c56c7b4f1879336234b561ce033f606c0d4ca8f2ffb278f1bc0e6aec3c504d844eecfa14046576fd63f5c1c0e4e6e3e75c3f2f53e4a1d7eed5e937334
7
+ data.tar.gz: 2c833ddc688c8e4594a574d36e04a3d7654e693b95332cfecb33c55336cdb457f255e10033f5e5ab448246de2b8b5e81ab0b83ae6cfabd2c9d7de1627c88010f
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
+ 2.1.68
2
+ : Use at_exit so color reset still runs when the pager path exits early,
3
+
1
4
  2.1.66
5
+ : Reset terminal colors after pager exits
2
6
 
3
7
  2.1.65
4
8
  : add nbsp_padding flag to toggle Non breaking space characters as right-padding
data/README.md CHANGED
@@ -275,6 +275,8 @@ Note that if you do this, and you need uncolored output to pipe somewhere, you'l
275
275
  There are a few great options for Markdown viewing in the Terminal. If `mdless` doesn't do it for you, check out:
276
276
 
277
277
  - [Glow](https://github.com/charmbracelet/glow)
278
+ - [mdcat](https://github.com/BIRSAx2/mdcat)
279
+ - [Apex](https://github.com/ApexMarkdown/apex/wiki/Rendering-Markdown-In-Terminal)
278
280
  - [Frogmouth](https://github.com/Textualize/frogmouth)
279
281
 
280
282
  <!--END README-->
@@ -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
 
@@ -616,6 +624,7 @@ module CLIMarkdown
616
624
  out.uncolor! unless MDLess.options[:color]
617
625
 
618
626
  if MDLess.options[:pager]
627
+ at_exit { reset_terminal } if MDLess.options[:color]
619
628
  page(out)
620
629
  else
621
630
  $stdout.print out.rstrip
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.66'
4
+ VERSION = '2.1.68'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.66
4
+ version: 2.1.68
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-13 00:00:00.000000000 Z
11
+ date: 2026-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet