jay_flavored_markdown 0.1.0 → 0.3.0

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: '09f1c03986bb811955d53a554cb8c41377f3a10c9ecb2cb98e9a3011e2488545'
4
- data.tar.gz: 206dd8840b28f631298ab74a7d6c3b2c6b2741f2fa4375ff5768723c6c535258
3
+ metadata.gz: 6b680c367d26d03ffad35ec1af8d1c45d8963a49cabbfd9dec0dcca1602faf93
4
+ data.tar.gz: c60ddd8f889659285bf04529b0ad91730e7c2df4bf15e2fe80d99dcc14a97e65
5
5
  SHA512:
6
- metadata.gz: fccbe5ddc45aa8b546b9dee699665a1a29d17348af42683be7db3788b341a502ec92717fe0d99444cfeef58eebb8705743a1e8c2e81bcf68d06b34ee016c9dc8
7
- data.tar.gz: 4c0dc0c27e992ddec948c34c249972a94b82a242c0166609dc5ee9f33fdf99575d9bfb2ab9c1ef0d3cd1703814cd55262a914685b6426201e71609fba50f8873
6
+ metadata.gz: 786f0f3b5a4b1ab674b067b07524b263bd61d7994c5313a21f6333c0a1558f798e8abdf95d84674a94de547ebd1e423445bd326b7a89ced8336e28d635068aeb
7
+ data.tar.gz: 2351f57c8c9f1ff44cf5fee961547f393327339e684497deac5f536fbed8121a438e9ef2df94054427589038291dd73d7809098b65bf5b38812753cddb7390a8
data/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
- ## [Unreleased]
1
+ ## [0.3.0] - 2026-06-11
2
+ - インデントの計算の正規表現を貪欲マッチから非貪欲マッチに変更した.(#12)
3
+ - ネストが深くなった際に出てくる箇条書きの○を小さくした.(#13)
4
+
5
+ ## [0.2.0] - 2025-04-11
6
+
7
+ ### General Changes
8
+ - ol が1つのスペースによってネストしないように変更した. (#6)
9
+ - 4段以上のインデントになると unordered list で itemize するようにした.(#9)
10
+ - Ruby 3.2 以上でも動作するように変更した. (#11)
11
+
12
+ ### Breaking Changes
13
+ - Acvtivesupport 7.1 以上を要求するように変更
2
14
 
3
15
  ## [0.1.0] - 2021-07-28
4
16
 
data/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jay_flavored_markdown`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
 
5
- JayFlavoredMarkdown is a markdown converter userd in [jay](https://github.com/nomlab/jay).
6
-
7
- click [here](https://matsuda0528.github.io/jay/extended_markdown.html) for more.
5
+ TODO: Delete this and the text above, and describe your gem
8
6
 
9
7
  ## Installation
10
8
 
@@ -24,31 +22,7 @@ Or install it yourself as:
24
22
 
25
23
  ## Usage
26
24
 
27
- ### Converting to plaintext
28
- ```ruby
29
- require 'jay_flavored_markdown'
30
-
31
- jfm = <<"EOS"
32
- + aaa
33
- + bbb
34
- EOS
35
-
36
- plaintext = JayFlavoredMarkdownToPlainTextConvereter.new(jfm).content
37
- #=> "(1) aaa\n (A) bbb"
38
- ```
39
-
40
- ### Converting to html
41
- ```ruby
42
- require 'jay_flavored_markdown'
43
-
44
- jfm = <<"EOS"
45
- + aaa
46
- + bbb
47
- EOS
48
-
49
- html = JayFlavoredMarkdownConverter.new(jfm).content
50
- #=> "<ol data-linenum=\"1\">\n <li class=\"bullet-list-item\" data-linenum=\"1\">\n<span class=\"bullet-list-marker\">(1)</span>aaa\n <ol data-linenum=\"2\">\n <li class=\"bullet-list-item\" data-linenum=\"2\">\n<span class=\"bullet-list-marker\">(A)</span>bbb</li>\n </ol>\n </li>\n</ol>"
51
- ```
25
+ TODO: Write usage instructions here
52
26
 
53
27
  ## Development
54
28
 
@@ -58,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
58
32
 
59
33
  ## Contributing
60
34
 
61
- Bug reports and pull requests are welcome on GitHub at https://github.com/nomlab/jay_flavored_markdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nomlab/jay_flavored_markdown/blob/master/CODE_OF_CONDUCT.md).
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jay_flavored_markdown. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/jay_flavored_markdown/blob/master/CODE_OF_CONDUCT.md).
62
36
 
63
37
  ## License
64
38
 
@@ -66,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
66
40
 
67
41
  ## Code of Conduct
68
42
 
69
- Everyone interacting in the JayFlavoredMarkdown project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nomlab/jay_flavored_markdown/blob/master/CODE_OF_CONDUCT.md).
43
+ Everyone interacting in the JayFlavoredMarkdown project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jay_flavored_markdown/blob/master/CODE_OF_CONDUCT.md).
@@ -13,7 +13,7 @@ module JayFlavoredMarkdown
13
13
 
14
14
  gemfile = File.expand_path("../../Gemfile", __FILE__)
15
15
 
16
- if File.exists?(gemfile + ".lock")
16
+ if File.exist?(gemfile + ".lock")
17
17
  ENV["BUNDLE_GEMFILE"] = gemfile
18
18
  require "bundler/setup"
19
19
  Bundler.require
@@ -12,13 +12,13 @@ Gem::Specification.new do |spec|
12
12
  spec.description = "JayFlavoredMarkdown Converter"
13
13
  spec.homepage = "https://github.com/nomlab/jay_flavored_markdown"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.4.0"
15
+ spec.required_ruby_version = ">= 3.0.0"
16
16
 
17
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
18
18
 
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/nomlab/jay_flavored_markdown"
21
- spec.metadata["changelog_uri"] = "https://github.com/nomlab/jay_flavored_markdown/blob/master/CHANGELOG.md"
19
+ # spec.metadata["homepage_uri"] = spec.homepage
20
+ # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
21
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency "gemoji"
39
39
  spec.add_dependency "sanitize"
40
40
  spec.add_dependency "rouge"
41
- spec.add_dependency "activesupport", "~> 6.1.4"
41
+ spec.add_dependency "activesupport", ">= 7.1"
42
42
 
43
43
  spec.add_development_dependency "rake", "~> 13.0"
44
44
  spec.add_development_dependency "minitest", "~> 5.0"
@@ -17,7 +17,7 @@
17
17
 
18
18
  # gemfile = File.expand_path("../../Gemfile", __FILE__)
19
19
 
20
- # if File.exists?(gemfile + ".lock")
20
+ # if File.exist?(gemfile + ".lock")
21
21
  # ENV["BUNDLE_GEMFILE"] = gemfile
22
22
  # require "bundler/setup"
23
23
  # Bundler.require
@@ -180,8 +180,8 @@ class MarkdownFeature
180
180
  end
181
181
 
182
182
  class ListItemFeature < MarkdownFeature
183
- START_REGEXP = /^\s*[+-] /
184
- INDENT = /^(\s*)/
183
+ START_REGEXP = /^(\s)*[*+-] /
184
+ INDENT = /^(\s{2,})/
185
185
  FEATURE_TYPE = :item
186
186
 
187
187
  def inside_of_list?(string, current_indent)
@@ -577,7 +577,11 @@ module Kramdown
577
577
  end
578
578
 
579
579
  if el.value.respond_to?(:mark)
580
- output << "<span class=\"bullet-list-marker\">(#{el.value.mark})</span>"
580
+ if el.value.mark.nil?
581
+ output << "<span class=\"bullet-list-marker\">・ &nbsp;</span>"
582
+ else
583
+ output << "<span class=\"bullet-list-marker\">(#{el.value.mark})</span>"
584
+ end
581
585
  end
582
586
 
583
587
  res = inner(el, indent)
@@ -826,7 +830,7 @@ class JayFillColumns < HTML::Pipeline::TextFilter
826
830
  # ^
827
831
  # Example2: " (A) This is ...."
828
832
  # ^
829
- if /(\A\s*([^\s]+ ::|\(.+\)) +)/ =~ str
833
+ if /(\A\s*([^\s]+ ::|\(.*?\)) +)/ =~ str
830
834
  return str_mb_width($1)
831
835
  else
832
836
  return 0
@@ -1059,12 +1063,12 @@ class JayFlavoredMarkdownConverter
1059
1063
  private
1060
1064
 
1061
1065
  def context
1062
- whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.deep_dup
1063
- whitelist[:attributes][:all] << "data-linenum"
1066
+ allowlist = HTML::Pipeline::SanitizationFilter::ALLOWLIST.deep_dup
1067
+ allowlist[:attributes][:all] << "data-linenum"
1064
1068
  {
1065
1069
  input: "GFM",
1066
1070
  asset_root: 'https://github.githubassets.com/images/icons/',
1067
- whitelist: whitelist,
1071
+ allowlist: allowlist,
1068
1072
  syntax_highlighter: :rouge,
1069
1073
  syntax_highlighter_opts: {inline_theme: true, line_numbers: true, code_class: 'codehilite'}
1070
1074
  }
@@ -1102,13 +1106,13 @@ class JayFlavoredMarkdownToPlainTextConverter
1102
1106
  private
1103
1107
 
1104
1108
  def context
1105
- whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST.deep_dup
1106
- whitelist[:attributes][:all] << "data-linenum"
1109
+ allowlist = HTML::Pipeline::SanitizationFilter::ALLOWLIST.deep_dup
1110
+ allowlist[:attributes][:all] << "data-linenum"
1107
1111
  {
1108
1112
  input: "GFM",
1109
1113
  # hard_wrap: false,
1110
1114
  asset_root: 'https://assets-cdn.github.com/images/icons/',
1111
- whitelist: whitelist
1115
+ allowlist: allowlist
1112
1116
  }
1113
1117
  end
1114
1118
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JayFlavoredMarkdown
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jay_flavored_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nomura Laboratory
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2026-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: activesupport
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 6.1.4
117
+ version: '7.1'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 6.1.4
124
+ version: '7.1'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -192,11 +192,7 @@ files:
192
192
  homepage: https://github.com/nomlab/jay_flavored_markdown
193
193
  licenses:
194
194
  - MIT
195
- metadata:
196
- allowed_push_host: https://rubygems.org
197
- homepage_uri: https://github.com/nomlab/jay_flavored_markdown
198
- source_code_uri: https://github.com/nomlab/jay_flavored_markdown
199
- changelog_uri: https://github.com/nomlab/jay_flavored_markdown/blob/master/CHANGELOG.md
195
+ metadata: {}
200
196
  post_install_message:
201
197
  rdoc_options: []
202
198
  require_paths:
@@ -205,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
201
  requirements:
206
202
  - - ">="
207
203
  - !ruby/object:Gem::Version
208
- version: 2.4.0
204
+ version: 3.0.0
209
205
  required_rubygems_version: !ruby/object:Gem::Requirement
210
206
  requirements:
211
207
  - - ">="
212
208
  - !ruby/object:Gem::Version
213
209
  version: '0'
214
210
  requirements: []
215
- rubygems_version: 3.2.3
211
+ rubygems_version: 3.5.22
216
212
  signing_key:
217
213
  specification_version: 4
218
214
  summary: JayFlavoredMarkdown Converter