cbeta 2.3.1 → 2.3.3

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: e18ce46f17a1f2ed24cdb9704a659eaff55a0953
4
- data.tar.gz: 5981915e4df0d2287ca49f66e2c891be4ab35107
3
+ metadata.gz: 332a09669b7f48f31c789ad21d8335fe41c1a35f
4
+ data.tar.gz: 8d1072d6f49fac6ca0460b0dc9a874aab30c508d
5
5
  SHA512:
6
- metadata.gz: 2bbf5b8a8539229d1fda051bea89f5ac275f970701b8bf8c12f344604c71ba5801412ace415aa9752f826528a5039b0abcbd9264e4536ed839c78ec91cfd2b2f
7
- data.tar.gz: a6a14200172c37e445897272ddc4c77ee63384e65b35ad67221efca8b198ff465d6f8f32dc0750bae14acff37c7ab45f8fe78ebdc89ea87bb1edf58976642e9c
6
+ metadata.gz: fb045fc89dffc72c5ef8699bfb6841e8a6f4ca3e8a1a8766ebbba232c408aafad2c9822a1681e99537700468385c5364359c6b3fa2dd11b1943a36ca15eab47a
7
+ data.tar.gz: c4883678aff3898753b012926da905165e26f5175bde614184f819a25aa5e36fb9865008378b1fdf3ef48615080b3dc30a68a0ecca3aa37d1dd63bfdca51a606
@@ -23,7 +23,7 @@ class CBETA::Gaiji
23
23
  # @return [nil] 如果該 CB 碼在 CBETA 缺字庫中不存在
24
24
  #
25
25
  # @example
26
- # g = Cbeta::Gaiji.new
26
+ # g = CBETA::Gaiji.new
27
27
  # g["CB01002"]
28
28
  #
29
29
  # Return:
@@ -362,8 +362,11 @@ class CBETA::P5aToHTMLForEveryEdition
362
362
  end
363
363
 
364
364
  def e_lb(e)
365
- # 卍續藏有 X 跟 R 兩種 lb, 只處理 X
366
- return '' if e['ed'] != @series
365
+ # 卍續藏有 X 跟 R 兩種 lb
366
+ if @series=='X' and e['ed'].start_with? 'R'
367
+ @lb_r = e['ed'] + '.' + e['n']
368
+ return ''
369
+ end
367
370
 
368
371
  @char_count = 1
369
372
  @lb = e['n']
@@ -692,7 +695,14 @@ class CBETA::P5aToHTMLForEveryEdition
692
695
 
693
696
  # 正文區的文字外面要包 span
694
697
  if @pass.last and mode=='html'
695
- r = "<span class='t' l='#{@lb}' w='#{@char_count}'>#{r}</span>"
698
+ doc = Nokogiri::XML::Document.new
699
+ node = doc.create_element('span')
700
+ node['class'] = 't'
701
+ node['l'] = @lb
702
+ node['lr'] = @lb_r if @series=='X'
703
+ node['w'] = @char_count
704
+ node.inner_html = r
705
+ r = to_html(node)
696
706
  @char_count += text_size
697
707
  end
698
708
  r
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbeta
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Chou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby gem for use Chinese Buddhist Text resources made by CBETA (http://www.cbeta.org).
14
14
  email: zhoubx@gmail.com