motion-markdown-it 4.4.0 → 8.4.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 +4 -4
- data/README.md +69 -16
- data/lib/motion-markdown-it.rb +7 -5
- data/lib/motion-markdown-it/common/html_blocks.rb +6 -2
- data/lib/motion-markdown-it/common/utils.rb +19 -4
- data/lib/motion-markdown-it/helpers/helper_wrapper.rb +9 -0
- data/lib/motion-markdown-it/helpers/parse_link_destination.rb +8 -7
- data/lib/motion-markdown-it/index.rb +60 -18
- data/lib/motion-markdown-it/parser_block.rb +7 -10
- data/lib/motion-markdown-it/parser_inline.rb +50 -14
- data/lib/motion-markdown-it/presets/commonmark.rb +7 -1
- data/lib/motion-markdown-it/presets/default.rb +4 -3
- data/lib/motion-markdown-it/presets/zero.rb +6 -1
- data/lib/motion-markdown-it/renderer.rb +46 -14
- data/lib/motion-markdown-it/rules_block/blockquote.rb +167 -31
- data/lib/motion-markdown-it/rules_block/code.rb +4 -3
- data/lib/motion-markdown-it/rules_block/fence.rb +9 -4
- data/lib/motion-markdown-it/rules_block/heading.rb +8 -3
- data/lib/motion-markdown-it/rules_block/hr.rb +10 -5
- data/lib/motion-markdown-it/rules_block/html_block.rb +6 -3
- data/lib/motion-markdown-it/rules_block/lheading.rb +64 -26
- data/lib/motion-markdown-it/rules_block/list.rb +91 -22
- data/lib/motion-markdown-it/rules_block/paragraph.rb +14 -9
- data/lib/motion-markdown-it/rules_block/reference.rb +24 -14
- data/lib/motion-markdown-it/rules_block/state_block.rb +79 -24
- data/lib/motion-markdown-it/rules_block/table.rb +52 -26
- data/lib/motion-markdown-it/rules_core/normalize.rb +1 -23
- data/lib/motion-markdown-it/rules_core/replacements.rb +22 -2
- data/lib/motion-markdown-it/rules_core/smartquotes.rb +41 -12
- data/lib/motion-markdown-it/rules_inline/autolink.rb +5 -4
- data/lib/motion-markdown-it/rules_inline/balance_pairs.rb +48 -0
- data/lib/motion-markdown-it/rules_inline/emphasis.rb +104 -149
- data/lib/motion-markdown-it/rules_inline/entity.rb +2 -2
- data/lib/motion-markdown-it/rules_inline/escape.rb +5 -3
- data/lib/motion-markdown-it/rules_inline/image.rb +12 -23
- data/lib/motion-markdown-it/rules_inline/link.rb +20 -25
- data/lib/motion-markdown-it/rules_inline/newline.rb +2 -1
- data/lib/motion-markdown-it/rules_inline/state_inline.rb +60 -1
- data/lib/motion-markdown-it/rules_inline/strikethrough.rb +81 -97
- data/lib/motion-markdown-it/rules_inline/text_collapse.rb +40 -0
- data/lib/motion-markdown-it/token.rb +46 -1
- data/lib/motion-markdown-it/version.rb +1 -1
- data/spec/motion-markdown-it/markdown_it_spec.rb +2 -2
- data/spec/motion-markdown-it/misc_spec.rb +90 -14
- data/spec/motion-markdown-it/testgen_helper.rb +1 -1
- data/spec/spec_helper.rb +2 -3
- metadata +13 -13
- data/lib/motion-markdown-it/common/url_schemas.rb +0 -173
- data/spec/motion-markdown-it/bench_mark_spec.rb +0 -44
@@ -1,44 +0,0 @@
|
|
1
|
-
# require 'kramdown'
|
2
|
-
#
|
3
|
-
# runs = 50
|
4
|
-
# files = ['mdsyntax.text', 'mdbasics.text']
|
5
|
-
# benchmark_dir = File.join(File.dirname(__FILE__), '../../benchmark')
|
6
|
-
#
|
7
|
-
# puts
|
8
|
-
# puts "Running tests on #{Time.now.strftime("%Y-%m-%d")} under #{RUBY_DESCRIPTION}"
|
9
|
-
#
|
10
|
-
# files.each do |file|
|
11
|
-
# data = File.read(File.join(benchmark_dir, file))
|
12
|
-
# puts
|
13
|
-
# puts "==> Test using file #{file} and #{runs} runs"
|
14
|
-
#
|
15
|
-
# # results = Benchmark.bmbm do |b|
|
16
|
-
# results = Benchmark.bm do |b|
|
17
|
-
# b.report("motion-markdown-it #{MotionMarkdownIt::VERSION}") do
|
18
|
-
# parser = MarkdownIt::Parser.new({ html: true, linkify: true, typographer: true })
|
19
|
-
# runs.times { parser.render(data) }
|
20
|
-
# end
|
21
|
-
# b.report("kramdown #{Kramdown::VERSION}") { runs.times { Kramdown::Document.new(data).to_html } }
|
22
|
-
# # b.report("markdown-it 4.0.1 JS") { runs.times { NSApplication.sharedApplication.delegate.markdown_it(data) } }
|
23
|
-
# # b.report(" hoedown 3.0.1") do
|
24
|
-
# # runs.times do
|
25
|
-
# # document = HoedownDocument.new
|
26
|
-
# # document.initWithHtmlRendererWithFlags(FLAGS)
|
27
|
-
# # html = document.renderMarkdownString(data)
|
28
|
-
# # end
|
29
|
-
# # end
|
30
|
-
# end
|
31
|
-
#
|
32
|
-
# # puts
|
33
|
-
# # puts "Real time of X divided by real time of kramdown"
|
34
|
-
# # kd = results.shift.real
|
35
|
-
# # %w[hoedown].each do |name|
|
36
|
-
# # puts name.ljust(19) << (results.shift.real/kd).round(4).to_s
|
37
|
-
# # end
|
38
|
-
# end
|
39
|
-
#
|
40
|
-
# describe "Benchmark Test" do
|
41
|
-
# it "benchmarks with mdsyntax.text and mdbasics.text" do
|
42
|
-
# expect(true).to eq true
|
43
|
-
# end
|
44
|
-
# end
|