review-retrovert 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/review/retrovert/converter.rb +10 -3
- data/lib/review/retrovert/version.rb +1 -1
- data/testdata/mybook/contents/r0-root.re +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1800fdc491a64bc922e8164e966bf6f84c4c2c2439a2330e106398ea97c55cc8
|
4
|
+
data.tar.gz: 3b1c672c1c85dc6ec2ca28628c64b4ba0f14263eacdc1952d4ca9427644446bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf0b640bb8ebb2e3f4549103dd73be14e2258f85a720580d8cb0bdb31d5f150e3ffde958dd77672ba16fd3a9b1f5a99e87d65927dfe9277186e529b89298c57
|
7
|
+
data.tar.gz: 5c16364152fc108a2214f1126f3583435dba1eafb080e6c07c3fc20a3de8d7702921e8a89143ce6577323182e10df3da50f9b3f08e07115203e1cbcb6d07a319
|
data/Gemfile.lock
CHANGED
@@ -307,7 +307,11 @@ module ReVIEW
|
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
|
-
def
|
310
|
+
def make_id_label(name)
|
311
|
+
name.gsub(/[^A-Za-z0-9]/, '_')
|
312
|
+
end
|
313
|
+
|
314
|
+
def add_linkurl_footnote(content, filename)
|
311
315
|
urls = {}
|
312
316
|
content.dup.scan(/(^.*)(@<href>{)(.*?)(,)(.*?)(})(.*)$/) { |m|
|
313
317
|
unless m[0].match(/^#@#/)
|
@@ -316,7 +320,7 @@ module ReVIEW
|
|
316
320
|
url = m[2]
|
317
321
|
text = m[4]
|
318
322
|
post = m[6]
|
319
|
-
id = "
|
323
|
+
id = "#{make_id_label(filename)}_link_auto_footnote#{urls.length}"
|
320
324
|
urls[id] = url
|
321
325
|
content.sub!(/#{Regexp.escape(matched)}$/, "#{prev}@<href>{#{url},#{text}} @<fn>{#{id}} #{post}")
|
322
326
|
end
|
@@ -335,6 +339,7 @@ module ReVIEW
|
|
335
339
|
|
336
340
|
def update_content(outdir, contentfile)
|
337
341
|
info contentfile
|
342
|
+
filename = File.basename(contentfile, '.*')
|
338
343
|
content = File.read(contentfile)
|
339
344
|
content.gsub!(/@<href>{(.*?)#.*?,(.*?)}/, '@<href>{\1,\2}')
|
340
345
|
content.gsub!(/@<href>{(.*?)#.*?}/, '@<href>{\1}')
|
@@ -374,6 +379,8 @@ module ReVIEW
|
|
374
379
|
|
375
380
|
# fixed lack of options
|
376
381
|
content.gsub!(/^\/\/list{/, '//list[][]{')
|
382
|
+
# empty br line to blankline
|
383
|
+
content.gsub!(/^\s*@<br>{}\s*$/, '//blankline')
|
377
384
|
|
378
385
|
if Gem::Version.new(ReVIEW::VERSION) >= Gem::Version.new('4.0.0')
|
379
386
|
# empty caption is not allow
|
@@ -384,7 +391,7 @@ module ReVIEW
|
|
384
391
|
replace_sampleoutput(content)
|
385
392
|
|
386
393
|
if linkurl_footnote
|
387
|
-
add_linkurl_footnote(content)
|
394
|
+
add_linkurl_footnote(content, filename)
|
388
395
|
end
|
389
396
|
|
390
397
|
# # br to blankline
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: review-retrovert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- srz_zumix
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|