pandoc2review 1.3.0 → 1.4.0
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 +4 -4
- data/README.md +4 -0
- data/lib/pandoc2review.rb +9 -1
- data/lua/filters.lua +1 -0
- data/lua/review.lua +5 -1
- data/pandoc2review.gemspec +1 -1
- 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: 8adcffddd4264746fd310194473ea979a7f884edda769a164fbbf9caa4a40fb0
|
4
|
+
data.tar.gz: b42b6d77e327254cd472a356736885735984742d16acabf360d337b1fdf09611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
data/pandoc2review.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode-eaw
|