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 +4 -4
- data/lib/asciidoctor/cjk_breaks_treeprocessor.rb +3 -6
- data/test/fixtures/footnote.txt +8 -0
- data/test/test_cjk_breaks.rb +2 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ab0bb16cfe28013986b1c52388a04745176560ea3504f49952a9d605395e7c5
|
4
|
+
data.tar.gz: bb8faf93ff3508affcc83873ea85ef1161dbfa9a77c0cd3bf5a6be3aa504337c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
29
|
-
#
|
30
|
-
|
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]
|
data/test/test_cjk_breaks.rb
CHANGED
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.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaizhao Zhang
|
8
|
-
|
8
|
+
- Kefu Chai
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
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:
|
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.
|
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: []
|