asciidoctor-pdf-cjk 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4873a2220e7a4f43135fe7b5fbf682b519515cb
4
- data.tar.gz: 5a2284a7d37a9fe72feceaed3c082209ad3fc320
3
+ metadata.gz: e9cd11f8007d30919399b1f00fe8436942f5a56a
4
+ data.tar.gz: 18963e488654fa8d9216dd5c1d11cc8330c20a85
5
5
  SHA512:
6
- metadata.gz: 2341bba54db734bc81500efe2531fa826be52fb95dbc299e8aae10d11ff7da1d9b741ee94e5005a0f673959a0c6eb268d13f53dfdd6f888d99a80a4bf3e1fb8c
7
- data.tar.gz: 70325b1988303031d8e885368a3ff9695edd3f3c45ee9fa058eb2e5be782512825fdf3d537a166c30c1b5a2747ed6be73ee4b3cfedc75b54b37c0cf39d40ce59
6
+ metadata.gz: 6484f5edcf84da57cdd7a2ddebc8cc0f6a0b436ae5c0da3b5297a33b0827e3348d60a68eeb41c862282198ad055dcf8f7b4b0822a0756ab4e98280cf35ea453c
7
+ data.tar.gz: 356a81c5527aec134b343e79f1d6636b104b761898e648975c42273be5edea9e8507176a0d68da40791e4e4c4d86bfc90f07417e6d05675ce724cfccbaa4d764
data/README.md CHANGED
@@ -10,7 +10,7 @@ Current do this things:
10
10
  Add this line to your application's Gemfile:
11
11
 
12
12
  ```ruby
13
- gem 'asciidoctor-pdf-cjk', '~> 0.1.1'
13
+ gem 'asciidoctor-pdf-cjk', '~> 0.1.2'
14
14
  ```
15
15
 
16
16
  And then execute:
@@ -29,10 +29,10 @@ Render PDF:
29
29
 
30
30
  ## Themes
31
31
 
32
- - [Asciidoctor::Pdf::CJK::KaiGenGothicCn](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic)
32
+ - [Asciidoctor::Pdf::CJK::KaiGenGothic](https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic)
33
33
 
34
34
  A theme using font [KaiGen Gothic](https://github.com/akiratw/kaigen-gothic).
35
35
 
36
36
  ## Contributing
37
37
 
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/asciidoctor-pdf-cjk.
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chloerei/asciidoctor-pdf-cjk.
@@ -5,6 +5,9 @@ require "asciidoctor/pdf/cjk/converter"
5
5
  module Asciidoctor
6
6
  module Pdf
7
7
  module Cjk
8
+ def self.break_words(string)
9
+ string.gsub(/(?<!^|\p{Space}|\p{Ps}|\p{Pi})[\p{Han}\p{Hiragana}\p{Katakana}\p{Ps}\p{Pi}]/) {|s| "#{::Prawn::Text::ZWSP}#{s}"}
10
+ end
8
11
  end
9
12
  end
10
13
  end
@@ -1,11 +1,11 @@
1
1
  module Asciidoctor
2
2
  module Pdf
3
3
  class Converter
4
- def typeset_text_with_break_word(string, line_metrics, opts = {})
5
- typeset_text_without_break_word string.gsub(/(?<!\p{Space})[\p{Han}\p{Hiragana}\p{Katakana}]/) {|s| "#{::Prawn::Text::ZWSP}#{s}"}, line_metrics, opts
4
+ def typeset_text_with_break_words(string, line_metrics, opts = {})
5
+ typeset_text_without_break_words ::Asciidoctor::Pdf::Cjk.break_words(string), line_metrics, opts
6
6
  end
7
- alias_method :typeset_text_without_break_word, :typeset_text
8
- alias_method :typeset_text, :typeset_text_with_break_word
7
+ alias_method :typeset_text_without_break_words, :typeset_text
8
+ alias_method :typeset_text, :typeset_text_with_break_words
9
9
  end
10
10
  end
11
11
  end
@@ -1,7 +1,7 @@
1
1
  module Asciidoctor
2
2
  module Pdf
3
3
  module Cjk
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-pdf-cjk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-12 00:00:00.000000000 Z
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor-pdf