pandoc2review 1.3.0 → 1.4.0

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: a5671aaebdb1909371f608bb0812d18f101827b5ccc06ee80532b48928d0f158
4
- data.tar.gz: 568f9cee83013a84b9a11691c4420e62b174fec7a88e5898b0a3ba565e0b2e52
3
+ metadata.gz: 8adcffddd4264746fd310194473ea979a7f884edda769a164fbbf9caa4a40fb0
4
+ data.tar.gz: b42b6d77e327254cd472a356736885735984742d16acabf360d337b1fdf09611
5
5
  SHA512:
6
- metadata.gz: 15129e6dffb240ca58c4da70834d4f16488da5b752c3302f313c9d0ff74eb614ec7d9e9d2615f688085b089035a9c8b3b32e8822470c6b0635c9bdb2427ea8c3
7
- data.tar.gz: 60a7d8451a10be4a98f21f9a5c0b934f5fe95cc7637aad9e1951dca092a3ab21d78b3838815ca0de95584b932085cdede8c8f0cfa86bcf5c135bef44d6514fd8
6
+ metadata.gz: 2b45bf183261d07b0970b8afdfe6f24a68f63aca8505bb082237140b6d377982697f1fecc5463d255cabb5ac38920ebf838b76cfc9feca8d61f9359ff121f32a
7
+ data.tar.gz: bea497ce7dba3bba8eaaefd41975bb820840803cf71260ce02901bfa5f30bc572d8c1706bbb68aa38f1d984fb980988fa9aba4c684e095c97d18daeffadce54e
data/README.md CHANGED
@@ -57,6 +57,10 @@ GNU General Public License Version 2
57
57
  - [@takahashim](https://github.com/takahashim)
58
58
 
59
59
  ## Changelog
60
+ ### 1.4.0
61
+ - Fix an error when empty div block is received.
62
+ - Introduce '--strip-emptydev' to strip empty block `//{-//}`, produced by TeX file.
63
+
60
64
  ### 1.3.0
61
65
  - Fix "attempt to index global 'first' (a nil value)" error in a docx file.
62
66
 
data/lib/pandoc2review.rb CHANGED
@@ -29,6 +29,10 @@ class Pandoc2ReVIEW
29
29
  end
30
30
  end
31
31
 
32
+ if @stripemptydev
33
+ args += ['-M', "stripemptydev:true"]
34
+ end
35
+
32
36
  if @heading
33
37
  args += ["--shift-heading-level-by=#{@heading}"]
34
38
  end
@@ -48,9 +52,10 @@ class Pandoc2ReVIEW
48
52
  @heading = nil
49
53
  @disableeaw = nil
50
54
  @hideraw = nil
55
+ @stripemptydev = nil
51
56
  opts = OptionParser.new
52
57
  opts.banner = 'Usage: pandoc2review [option] file [file ...]'
53
- opts.version = '1.3'
58
+ opts.version = '1.4'
54
59
 
55
60
  opts.on('--help', 'Prints this message and quit.') do
56
61
  puts opts.help
@@ -65,6 +70,9 @@ class Pandoc2ReVIEW
65
70
  opts.on('--hideraw', "Hide raw inline/block with no review format specified.") do
66
71
  @hideraw = true
67
72
  end
73
+ opts.on('--strip-emptydev', "Strip <div> without any id or class") do
74
+ @stripemptydev = true
75
+ end
68
76
 
69
77
  opts.parse!(ARGV)
70
78
  if ARGV.size != 1
data/lua/filters.lua CHANGED
@@ -102,6 +102,7 @@ local function caption_div(div)
102
102
  local caption = div.attributes.caption
103
103
 
104
104
  if ((#div.content == 1) and
105
+ (div.content[1].content) and
105
106
  (#div.content[1].content == 1) and
106
107
  (div.content[1].content[1].tag == "Math") and
107
108
  (div.identifier)) then
data/lua/review.lua CHANGED
@@ -522,7 +522,11 @@ function Div(s, attr)
522
522
  local classes = attr_classes(attr)
523
523
 
524
524
  if next(classes) == nil then
525
- return "//{\n" .. s .. "\n//}"
525
+ if metadata.stripemptydev then
526
+ return s
527
+ else
528
+ return "//{\n" .. s .. "\n//}"
529
+ end
526
530
  end
527
531
 
528
532
  if classes["review-internal"] then
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "pandoc2review"
3
- spec.version = "1.3.0"
3
+ spec.version = "1.4.0"
4
4
  spec.authors = ["Kenshi Muto"]
5
5
  spec.email = ["kmuto@kmuto.jp"]
6
6
  spec.license = "GPL-2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandoc2review
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenshi Muto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-09 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unicode-eaw