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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88019dcbdef1f19522028bd668913c7f2100d2774796ca208a7e72df829b3ef
4
- data.tar.gz: 4b3605223424275e592269e6fbfd1124275087c322522b0d5cb309434ee202ac
3
+ metadata.gz: 1800fdc491a64bc922e8164e966bf6f84c4c2c2439a2330e106398ea97c55cc8
4
+ data.tar.gz: 3b1c672c1c85dc6ec2ca28628c64b4ba0f14263eacdc1952d4ca9427644446bf
5
5
  SHA512:
6
- metadata.gz: 519813a8c9690db53484fb206084a97c36c8bfe1c230fe09bb623c7d93ce178a81b1bb91eed87a9edfb1c753b345e0d12ca36f50bf8789ea0a6906126b62e771
7
- data.tar.gz: '02823e04d7787079bcf94273ab43af37d903c8d8de357fde7c8394094ff88a5e2275e173284496eccf328f74da11c11b8b3d2233814529cb00b4021ff014b19d'
6
+ metadata.gz: acf0b640bb8ebb2e3f4549103dd73be14e2258f85a720580d8cb0bdb31d5f150e3ffde958dd77672ba16fd3a9b1f5a99e87d65927dfe9277186e529b89298c57
7
+ data.tar.gz: 5c16364152fc108a2214f1126f3583435dba1eafb080e6c07c3fc20a3de8d7702921e8a89143ce6577323182e10df3da50f9b3f08e07115203e1cbcb6d07a319
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- review-retrovert (0.9.4)
4
+ review-retrovert (0.9.5)
5
5
  review (>= 3.0.0)
6
6
  thor
7
7
 
@@ -307,7 +307,11 @@ module ReVIEW
307
307
  end
308
308
  end
309
309
 
310
- def add_linkurl_footnote(content)
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 = "link_auto_footnote#{urls.length}"
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
@@ -1,5 +1,5 @@
1
1
  module ReVIEW
2
2
  module Retrovert
3
- VERSION = "0.9.4"
3
+ VERSION = "0.9.5"
4
4
  end
5
5
  end
@@ -2,3 +2,8 @@
2
2
 
3
3
  #@mapfile(contents/r0-inner.re)
4
4
  #@end
5
+
6
+ @<br>{}
7
+
8
+ test@<br>{}
9
+
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
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-15 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor