asciidoctor_cjk_breaks 0.0.2 → 0.0.3

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: 03ca0087d1fa376ff0798af72d2af93a9ff65de401f3ec9cf9f87f881ff34055
4
- data.tar.gz: af10c813c19a1d60eae229d7426256e76c4e7c4e6418362c5b69e66796984d18
3
+ metadata.gz: 2ab0bb16cfe28013986b1c52388a04745176560ea3504f49952a9d605395e7c5
4
+ data.tar.gz: bb8faf93ff3508affcc83873ea85ef1161dbfa9a77c0cd3bf5a6be3aa504337c
5
5
  SHA512:
6
- metadata.gz: d98b69981d5d936478b2e5c89f6de7c8b820248c1e6529e1f81d74c88281360e036a952e03199bc3bbd35018cec2defd4d3e38d1ad08f876701ce3749cf143d8
7
- data.tar.gz: 2e7d4cf825dab40200cf75da3d19072abbf5189d1d739d2ff692bce8aaa43ae0d148c37478b74b95c10e9afa090cb55a8764ca40f58b865d202371947404665c
6
+ metadata.gz: 0ac77115546662ea97a1c6a35013f3168861c1376863c69b22b5837ff5bb566a44c7cb7a0275ff84ae8fd926aa6ac5935931bfa7244517b4329306e753ce1648
7
+ data.tar.gz: 2c35b6d8a78928e5db7421a42f522d4c9ececf6cc69f307bd35fcd7d8df86a4085182d96d336b6e5dc9bbdf514e84d24bb873691e96d66f018e99ccc6e6d1303
@@ -25,12 +25,9 @@ class CjkBreaksTreeprocessor < Asciidoctor::Extensions::Treeprocessor
25
25
 
26
26
  def remove_cjk_breaks(block)
27
27
  content_changed = false
28
- # Processing after raw_source -> block.lines -> block.content in asciidoctor.
29
- # It may be better to make this process while the process from raw_source -> block.lines
30
- # whose code flow is:
31
- # -> `Asciidoctor::Block.initialize`
32
- # -> `Asciidoctor::Helpers.normalize_lines_from_string`.
33
- lines = block.content.lines
28
+ # NOTE: use block.lines instead of block.content to avoid issues of auto-generated content e.g. footnotes.
29
+ # see source code: https://github.com/asciidoctor/asciidoctor/blob/v2.0.23/lib/asciidoctor/block.rb#L98-L129
30
+ lines = block.lines
34
31
  lines.each_with_index do |line, line_index|
35
32
  last_char_idx = line.rindex(/[^\r|\n]/)
36
33
  last_char = line[last_char_idx]
@@ -0,0 +1,8 @@
1
+ wordfootnote:[nota bene a].
2
+ word{empty}footnote:[nota bene b].
3
+ wordfootnote:[nota bene again].
4
+
5
+ See <<heading>>.
6
+
7
+ [[heading,Heading]]
8
+ == Headingfootnote:[This is a heading with a footnote]
@@ -5,3 +5,5 @@ Asciidoctor.convert_file 'test/fixtures/tengwanggexu-wangbo.txt'
5
5
 
6
6
  Asciidoctor.convert_file 'test/fixtures/dlist.txt'
7
7
  Asciidoctor.convert_file 'test/fixtures/table.txt'
8
+
9
+ Asciidoctor.convert_file 'test/fixtures/footnote.txt'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor_cjk_breaks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaizhao Zhang
8
- autorequire:
8
+ - Kefu Chai
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -40,7 +40,9 @@ dependencies:
40
40
  version: '0'
41
41
  description: An extension for Asciidoctor that suppresses line breaks between east
42
42
  asian characters.
43
- email: zhangkaizhao@gmail.com
43
+ email:
44
+ - zhangkaizhao@gmail.com
45
+ - tchaikov@gmail.com
44
46
  executables: []
45
47
  extensions: []
46
48
  extra_rdoc_files: []
@@ -50,6 +52,7 @@ files:
50
52
  - lib/asciidoctor_cjk_breaks.rb
51
53
  - test/fixtures/cjk_breaks.txt
52
54
  - test/fixtures/dlist.txt
55
+ - test/fixtures/footnote.txt
53
56
  - test/fixtures/table.txt
54
57
  - test/fixtures/tengwanggexu-wangbo.txt
55
58
  - test/test_cjk_breaks.rb
@@ -57,7 +60,6 @@ homepage: https://github.com/zhangkaizhao/asciidoctor_cjk_breaks
57
60
  licenses:
58
61
  - MIT
59
62
  metadata: {}
60
- post_install_message:
61
63
  rdoc_options: []
62
64
  require_paths:
63
65
  - lib
@@ -72,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
74
  - !ruby/object:Gem::Version
73
75
  version: '0'
74
76
  requirements: []
75
- rubygems_version: 3.1.4
76
- signing_key:
77
+ rubygems_version: 3.6.7
77
78
  specification_version: 4
78
79
  summary: Suppress line breaks between east asian characters
79
80
  test_files: []