jay_flavored_markdown 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +4 -30
- data/exe/jay_flavored_markdown +1 -1
- data/jay_flavored_markdown.gemspec +6 -6
- data/lib/jay_flavored_markdown/markdown_converter.rb +14 -10
- data/lib/jay_flavored_markdown/version.rb +1 -1
- metadata +9 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2457db4a5becde52a86be711acfcf16f4ee7809ca5a58b2d955c00313216b075
|
4
|
+
data.tar.gz: e63bc794afdf5c59ac0e66c3ebd39308b2242eb7766a48b1a97b55354befbdb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98bdbcf51ee8e1ae4508f52310b8fece85f1970715395b3f0e2e3f70167c3bd3c9bcf1a695932928c8a543603e8e48115f3303757636ea773a230d7078ada71c
|
7
|
+
data.tar.gz: ee8ab51143a69a67106caac3eedd5b3cf04da96c21511594f84f92fa017e51f0c2f867b51b79616ef836a6ec30f6b1f219819c70fef49f7938bc49f65a2cebc3
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
## [
|
1
|
+
## [0.2.0] - 2025-04-11
|
2
|
+
|
3
|
+
### General Changes
|
4
|
+
- ol が1つのスペースによってネストしないように変更した. (#6)
|
5
|
+
- 4段以上のインデントになると unordered list で itemize するようにした.(#9)
|
6
|
+
- Ruby 3.2 以上でも動作するように変更した. (#11)
|
7
|
+
|
8
|
+
### Breaking Changes
|
9
|
+
- Acvtivesupport 7.1 以上を要求するように変更
|
2
10
|
|
3
11
|
## [0.1.0] - 2021-07-28
|
4
12
|
|
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
|
-
|
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
|
-
|
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/
|
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/
|
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).
|
data/exe/jay_flavored_markdown
CHANGED
@@ -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 = ">=
|
15
|
+
spec.required_ruby_version = ">= 3.0.0"
|
16
16
|
|
17
|
-
spec.metadata["allowed_push_host"] = "https://
|
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"] = "
|
21
|
-
spec.metadata["changelog_uri"] = "
|
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", "
|
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.
|
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 =
|
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
|
-
|
580
|
+
if el.value.mark.nil?
|
581
|
+
output << "<span class=\"bullet-list-marker\">● </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)
|
@@ -1059,12 +1063,12 @@ class JayFlavoredMarkdownConverter
|
|
1059
1063
|
private
|
1060
1064
|
|
1061
1065
|
def context
|
1062
|
-
|
1063
|
-
|
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
|
-
|
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
|
-
|
1106
|
-
|
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
|
-
|
1115
|
+
allowlist: allowlist
|
1112
1116
|
}
|
1113
1117
|
end
|
1114
1118
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jay_flavored_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nomura Laboratory
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-11 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: kramdown
|
@@ -112,16 +111,16 @@ dependencies:
|
|
112
111
|
name: activesupport
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
|
-
- - "
|
114
|
+
- - ">="
|
116
115
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
116
|
+
version: '7.1'
|
118
117
|
type: :runtime
|
119
118
|
prerelease: false
|
120
119
|
version_requirements: !ruby/object:Gem::Requirement
|
121
120
|
requirements:
|
122
|
-
- - "
|
121
|
+
- - ">="
|
123
122
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
123
|
+
version: '7.1'
|
125
124
|
- !ruby/object:Gem::Dependency
|
126
125
|
name: rake
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,12 +191,7 @@ files:
|
|
192
191
|
homepage: https://github.com/nomlab/jay_flavored_markdown
|
193
192
|
licenses:
|
194
193
|
- 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
|
200
|
-
post_install_message:
|
194
|
+
metadata: {}
|
201
195
|
rdoc_options: []
|
202
196
|
require_paths:
|
203
197
|
- lib
|
@@ -205,15 +199,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
199
|
requirements:
|
206
200
|
- - ">="
|
207
201
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
202
|
+
version: 3.0.0
|
209
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
204
|
requirements:
|
211
205
|
- - ">="
|
212
206
|
- !ruby/object:Gem::Version
|
213
207
|
version: '0'
|
214
208
|
requirements: []
|
215
|
-
rubygems_version: 3.2
|
216
|
-
signing_key:
|
209
|
+
rubygems_version: 3.6.2
|
217
210
|
specification_version: 4
|
218
211
|
summary: JayFlavoredMarkdown Converter
|
219
212
|
test_files: []
|