cbeta 2.6.0 → 2.6.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b24e772092f7738eae2eeaf8cd498d986fb1d08f00c6fc2a8caa8c47fa68643b
|
4
|
+
data.tar.gz: c2163e1216efb00ea0355ced47f2dbed89f269114005a0e766369215a100ec6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5afb61e80f6d2750ceab6d842351b6fe0fed78ba4d1f602a11367a81611d97b0b6948ac950e7129e6cd298e3600173552798baae421031996e9f68fbb37c3e47
|
7
|
+
data.tar.gz: a140761830f6dd34f890c078f28cb48aecbc168a48aed28bdf7d54508612df733103a5aaafb9b016568c2dd65e6a1e8ce924d86048fc6d9c2f99cd707f261acf
|
data/lib/cbeta/p5a_to_html.rb
CHANGED
@@ -161,6 +161,11 @@ class CBETA::P5aToHTML
|
|
161
161
|
def e_figure(e)
|
162
162
|
"<p class='figure'>%s</p>" % traverse(e)
|
163
163
|
end
|
164
|
+
|
165
|
+
def e_foreign(e)
|
166
|
+
return '' if e.key?('place') and e['place'].include?('foot')
|
167
|
+
traverse(e)
|
168
|
+
end
|
164
169
|
|
165
170
|
def e_g(e, mode)
|
166
171
|
# if 有 <mapping type="unicode">
|
@@ -509,7 +514,7 @@ class CBETA::P5aToHTML
|
|
509
514
|
when 'corr' then e_corr(e)
|
510
515
|
when 'div' then e_div(e)
|
511
516
|
when 'figure' then e_figure(e)
|
512
|
-
when 'foreign' then
|
517
|
+
when 'foreign' then e_foreign(e)
|
513
518
|
when 'g' then e_g(e, mode)
|
514
519
|
when 'graphic' then e_graphic(e)
|
515
520
|
when 'head' then e_head(e)
|
@@ -228,6 +228,11 @@ class CBETA::P5aToHTMLForEveryEdition
|
|
228
228
|
def e_figure(e)
|
229
229
|
"<p class='figure'>%s</p>" % traverse(e)
|
230
230
|
end
|
231
|
+
|
232
|
+
def e_foreign(e)
|
233
|
+
return '' if e.key?('place') and e['place'].include?('foot')
|
234
|
+
traverse(e)
|
235
|
+
end
|
231
236
|
|
232
237
|
def e_g(e, mode)
|
233
238
|
# if 有 <mapping type="unicode">
|
@@ -624,7 +629,7 @@ class CBETA::P5aToHTMLForEveryEdition
|
|
624
629
|
when 'corr' then e_corr(e)
|
625
630
|
when 'div' then e_div(e)
|
626
631
|
when 'figure' then e_figure(e)
|
627
|
-
when 'foreign' then
|
632
|
+
when 'foreign' then e_foreign(e)
|
628
633
|
when 'g' then e_g(e, mode)
|
629
634
|
when 'graphic' then e_graphic(e)
|
630
635
|
when 'head' then e_head(e)
|
@@ -234,6 +234,11 @@ class CBETA::P5aToHTMLForPDF
|
|
234
234
|
def handle_figure(e)
|
235
235
|
"<div class='figure'>%s</div>" % traverse(e)
|
236
236
|
end
|
237
|
+
|
238
|
+
def handle_foreign(e)
|
239
|
+
return '' if e.key?('place') and e['place'].include?('foot')
|
240
|
+
traverse(e)
|
241
|
+
end
|
237
242
|
|
238
243
|
def handle_g(e, mode)
|
239
244
|
# 悉曇字、蘭札體 使用圖檔
|
@@ -453,7 +458,7 @@ class CBETA::P5aToHTMLForPDF
|
|
453
458
|
when 'docNumber' then handle_doc_number(e)
|
454
459
|
when 'div' then handle_div(e)
|
455
460
|
when 'figure' then handle_figure(e)
|
456
|
-
when 'foreign' then
|
461
|
+
when 'foreign' then handle_foreign(e)
|
457
462
|
when 'g' then handle_g(e, mode)
|
458
463
|
when 'graphic' then handle_graphic(e)
|
459
464
|
when 'head' then handle_head(e)
|
@@ -108,6 +108,11 @@ class CBETA::P5aToSimpleHTML
|
|
108
108
|
end
|
109
109
|
r
|
110
110
|
end
|
111
|
+
|
112
|
+
def handle_foreign(e)
|
113
|
+
return '' if e.key?('place') and e['place'].include?('foot')
|
114
|
+
traverse(e)
|
115
|
+
end
|
111
116
|
|
112
117
|
def handle_g(e)
|
113
118
|
# if 悉曇字、蘭札體
|
@@ -187,7 +192,7 @@ class CBETA::P5aToSimpleHTML
|
|
187
192
|
when 'anchor' then handle_anchor(e)
|
188
193
|
when 'back' then ''
|
189
194
|
when 'corr' then handle_corr(e)
|
190
|
-
when 'foreign' then
|
195
|
+
when 'foreign' then handle_foreign(e)
|
191
196
|
when 'g' then handle_g(e)
|
192
197
|
when 'graphic' then ''
|
193
198
|
when 'lb' then handle_lb(e)
|
data/lib/cbeta/p5a_to_text.rb
CHANGED
@@ -184,6 +184,11 @@ class CBETA::P5aToText
|
|
184
184
|
r += @settings[:format] == 'app' ? "\t" : "\n"
|
185
185
|
r
|
186
186
|
end
|
187
|
+
|
188
|
+
def e_foreign(e)
|
189
|
+
return '' if e.key?('place') and e['place'].include?('foot')
|
190
|
+
traverse(e)
|
191
|
+
end
|
187
192
|
|
188
193
|
def e_g(e)
|
189
194
|
# if 悉曇字、蘭札體
|
@@ -392,7 +397,7 @@ class CBETA::P5aToText
|
|
392
397
|
when 'div' then e_div(e)
|
393
398
|
when 'docNumber' then e_docNumber(e)
|
394
399
|
when 'figure' then e_figure(e)
|
395
|
-
when 'foreign' then
|
400
|
+
when 'foreign' then e_foreign(e)
|
396
401
|
when 'g' then e_g(e)
|
397
402
|
when 'graphic' then e_graphic(e)
|
398
403
|
when 'head' then e_head(e)
|
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.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-20 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
|