kramdown-ansi 0.0.0 → 0.0.1

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: 7249444853b46b626b782ea417e62827627ba0d1da6f54cc8801f8459839f775
4
- data.tar.gz: 75884f2bf3c0e3b06e71c28f9f4775315745b76ab9cf0d73ec57e49829cd7f6f
3
+ metadata.gz: dd37ac254127e9b4654a9a7621159894bee90193506f2b30fad07e3db7978663
4
+ data.tar.gz: 9cf0fa562dd8e274b7fba315c85c9148082ba71afdaf5a9f11a4e2ba201787b9
5
5
  SHA512:
6
- metadata.gz: 10c992685654c67686a24e4a323ab04619d8957faa61a119569e16dbdb82119278b2756b3cf8d3ba921f7343997d12ddb6632fc8fc3379b00be844862e730d4a
7
- data.tar.gz: d3342cdf38698f5f59035b0a06dff0341a3fc66127d4de3fd7de46d25d55831175a087f6375fb2052f5e10ff1aabb026026361ab3e73f9a87329b19f3be2d05d
6
+ metadata.gz: 8e72c1899f5338ed596bd4dc6a367e9ed32d9eb3a1cdcbc9ec9c4b1476557934de5ac5706d63f85a77f73880ad6a0316a26a5b58f4768cf77aebcf0d9076cc1b
7
+ data.tar.gz: 7cdd5cde26c6e8a15975d75c867fa57b78fe07794b6a785802c6c5098fc6004a2b1a6b95d78eca4ad58df3c0ef214ffc5e2d4d4b27502d436a40db10b5711229
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2024-10-31 v0.0.1
4
+
5
+ * Strip CSI and OSC sequences in `Terminal::Table`:
6
+ + Fix size calculations
7
+
3
8
  ## 2024-10-31 v0.0.0
4
9
 
5
10
  * Start
data/README.md CHANGED
@@ -39,8 +39,8 @@ puts Kramdown::ANSI.parse(markdown)
39
39
 
40
40
  | Method | Description |
41
41
  | :----- | :---------- |
42
- | `md` executable | Outputs Markdown files with ANSI escape sequences in the terminal |
43
- | `git-md` executable | A Git plugin that outputs Markdown formatted git commit messages into the terminal |
42
+ | `md` executable | Outputs [Markdown](https://spec.commonmark.org/current/) files with ANSI escape sequences in the terminal |
43
+ | `git-md` executable | A Git plugin that outputs [Markdown](https://spec.commonmark.org/current/) formatted git commit messages into the terminal |
44
44
 
45
45
  ### The md executable
46
46
 
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: kramdown-ansi 0.0.0 ruby lib
2
+ # stub: kramdown-ansi 0.0.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "kramdown-ansi".freeze
6
- s.version = "0.0.0".freeze
6
+ s.version = "0.0.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
data/lib/kramdown/ansi.rb CHANGED
@@ -13,6 +13,12 @@ class Kramdown::ANSI < Kramdown::Converter::Base
13
13
  include Term::ANSIColor
14
14
  include Kramdown::ANSI::Width
15
15
 
16
+ module Terminal::Table::Util
17
+ def self.ansi_escape(line)
18
+ line.to_s.gsub(/\e\[.*?m|\e\].*?(\e|\a)\\?/, '')
19
+ end
20
+ end
21
+
16
22
  class ::Kramdown::Parser::Mygfm < ::Kramdown::Parser::GFM
17
23
  def initialize(source, options)
18
24
  options[:gfm_quirks] << :no_auto_typographic
@@ -1,6 +1,6 @@
1
1
  module Kramdown
2
2
  # Kramdown version
3
- VERSION = '0.0.0'
3
+ VERSION = '0.0.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-ansi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank