reverse_adoc 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -20
- data/.github/workflows/release.yml +6 -27
- data/lib/reverse_adoc/converters/pre.rb +5 -1
- data/lib/reverse_adoc/converters/text.rb +3 -5
- data/lib/reverse_adoc/version.rb +1 -1
- data/reverse_adoc.gemspec +2 -2
- data/spec/components/code_spec.rb +4 -4
- data/spec/components/escapables_spec.rb +2 -1
- data/spec/components/paragraphs_spec.rb +1 -1
- data/spec/components/quotation_spec.rb +1 -1
- data/spec/lib/reverse_adoc/converters/pre_spec.rb +1 -1
- data/spec/lib/reverse_adoc/converters/text_spec.rb +8 -2
- metadata +10 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f270330f82dbb25f80910714935e876e97d426537c4a5abd463e7bc9640e6467
|
4
|
+
data.tar.gz: 75b1f4e34156d28e64f93b8cdebd938b4286e3570154bc51f52386d3d14b69ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682c02207ff5b6f9d403c3ddfbbb6733e71efcf4d0fd20b4c48aebaf48e42e241b4195753cddcffc8216870ec17338964fcc24c35aeb201fa0867e678cec3bff
|
7
|
+
data.tar.gz: 710296feb3d170223920b46184ebb7b80216db873376ff38e742cfc1b7c1935ad867e0b3bb0435d5bb5a557c46be0c3da0aeaccc1169c2363aa2eda2d95dfbde
|
data/.github/workflows/rake.yml
CHANGED
@@ -10,23 +10,6 @@ on:
|
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
rake:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
strategy:
|
17
|
-
fail-fast: false
|
18
|
-
matrix:
|
19
|
-
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
|
-
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
|
-
experimental: [ false ]
|
22
|
-
steps:
|
23
|
-
- uses: actions/checkout@master
|
24
|
-
|
25
|
-
- uses: ruby/setup-ruby@v1
|
26
|
-
with:
|
27
|
-
ruby-version: ${{ matrix.ruby }}
|
28
|
-
bundler-cache: true
|
29
|
-
|
30
|
-
- uses: metanorma/metanorma-build-scripts/libreoffice-setup-action@master
|
31
|
-
|
32
|
-
- run: bundle exec rake
|
13
|
+
uses: metanorma/ci/.github/workflows/libreoffice-rake.yml@main
|
14
|
+
secrets:
|
15
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
@@ -15,31 +15,10 @@ on:
|
|
15
15
|
|
16
16
|
jobs:
|
17
17
|
release:
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
|
19
|
+
with:
|
20
|
+
next_version: ${{ github.event.inputs.next_version }}
|
21
|
+
secrets:
|
22
|
+
rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
|
23
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
21
24
|
|
22
|
-
- uses: ruby/setup-ruby@v1
|
23
|
-
with:
|
24
|
-
ruby-version: '2.6'
|
25
|
-
bundler-cache: true
|
26
|
-
|
27
|
-
- run: gem install gem-release
|
28
|
-
|
29
|
-
- if: ${{ github.event_name == 'workflow_dispatch' }} && ${{ github.event.inputs.next_version != 'skip' }}
|
30
|
-
run: |
|
31
|
-
git config user.name github-actions
|
32
|
-
git config user.email github-actions@github.com
|
33
|
-
gem bump --version ${{ github.event.inputs.next_version }} --tag --push
|
34
|
-
|
35
|
-
- name: publish to rubygems.org
|
36
|
-
env:
|
37
|
-
RUBYGEMS_API_KEY: ${{secrets.METANORMA_CI_RUBYGEMS_API_KEY}}
|
38
|
-
run: |
|
39
|
-
gem install gem-release
|
40
|
-
envsubst << 'EOF' > ~/.gem/credentials
|
41
|
-
---
|
42
|
-
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
43
|
-
EOF
|
44
|
-
chmod 0600 ~/.gem/credentials
|
45
|
-
gem release
|
@@ -32,17 +32,15 @@ module ReverseAdoc
|
|
32
32
|
text = escape_keychars(text)
|
33
33
|
|
34
34
|
text = preserve_keychars_within_backticks(text)
|
35
|
-
|
36
|
-
|
37
|
-
text
|
35
|
+
escape_links(text)
|
38
36
|
end
|
39
37
|
|
40
38
|
def preserve_nbsp(text)
|
41
39
|
text.gsub(/\u00A0/, " ")
|
42
40
|
end
|
43
41
|
|
44
|
-
def
|
45
|
-
text.gsub(
|
42
|
+
def escape_links(text)
|
43
|
+
text.gsub(/<<([^>]*)>>/, "\\<<\\1>>")
|
46
44
|
end
|
47
45
|
|
48
46
|
def remove_border_newlines(text)
|
data/lib/reverse_adoc/version.rb
CHANGED
data/reverse_adoc.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
|
20
20
|
s.bindir = "exe"
|
21
21
|
s.require_paths = ["lib"]
|
22
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.
|
22
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
23
23
|
|
24
24
|
# specify any dependencies here; for example:
|
25
25
|
s.add_dependency "marcel", "~> 1.0.0"
|
26
26
|
s.add_dependency "mathml2asciimath"
|
27
|
-
s.add_dependency "nokogiri", "~> 1.
|
27
|
+
s.add_dependency "nokogiri", "~> 1.13"
|
28
28
|
s.add_development_dependency "codeclimate-test-reporter"
|
29
29
|
s.add_development_dependency "rake"
|
30
30
|
s.add_development_dependency "redcarpet"
|
@@ -7,19 +7,19 @@ describe ReverseAdoc do
|
|
7
7
|
subject { ReverseAdoc.convert(input) }
|
8
8
|
|
9
9
|
it { is_expected.to match /inline `code` block/ }
|
10
|
-
it { is_expected.to match /\
|
10
|
+
it { is_expected.to match /\nvar this;\nthis\.is/ }
|
11
11
|
it { is_expected.to match /block"\)\nconsole/ }
|
12
12
|
|
13
13
|
context "with github style code blocks" do
|
14
14
|
subject { ReverseAdoc.convert(input) }
|
15
15
|
it { is_expected.to match /inline `code` block/ }
|
16
|
-
it { is_expected.to match /\n\.\.\.\.\
|
17
|
-
it { is_expected.to match /it is"\) ?\n
|
16
|
+
it { is_expected.to match /\n\.\.\.\.\nvar this;\nthis/ }
|
17
|
+
it { is_expected.to match /it is"\) ?\n \n\.\.\.\./ }
|
18
18
|
end
|
19
19
|
|
20
20
|
context "code with indentation" do
|
21
21
|
subject { ReverseAdoc.convert(input) }
|
22
|
-
it { is_expected.to match(
|
22
|
+
it { is_expected.to match(/^tell application "Foo"\n/) }
|
23
23
|
it { is_expected.to match(/^ beep\n/) }
|
24
24
|
it { is_expected.to match(/^end tell\n/) }
|
25
25
|
end
|
@@ -25,7 +25,8 @@ describe ReverseAdoc do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
context "underscores within words in code blocks" do
|
28
|
-
|
28
|
+
let(:expected_output) { "....\nvar theoretical_max_infin = 1.0;\n....\n" }
|
29
|
+
it { is_expected.to include expected_output }
|
29
30
|
end
|
30
31
|
|
31
32
|
end
|
@@ -8,7 +8,7 @@ describe ReverseAdoc do
|
|
8
8
|
|
9
9
|
it { is_expected.not_to start_with "\n\n" }
|
10
10
|
it { is_expected.to start_with "First content\n\nSecond content\n\n" }
|
11
|
-
it { is_expected.to include "\n\n_Complex_\n\n\.\.\.\.\n\n
|
11
|
+
it { is_expected.to include "\n\n_Complex_\n\n\.\.\.\.\n\n Content\n" }
|
12
12
|
it { is_expected.to include "*Trailing whitespace:*" }
|
13
13
|
it { is_expected.to include "*Trailing non-breaking space: *" }
|
14
14
|
it { is_expected.to include "*_Combination: _*" }
|
@@ -6,7 +6,7 @@ describe ReverseAdoc do
|
|
6
6
|
let(:document) { Nokogiri::HTML(input) }
|
7
7
|
subject { ReverseAdoc.convert(input) }
|
8
8
|
|
9
|
-
it { is_expected.to match /\n
|
9
|
+
it { is_expected.to match /\n Block of code$/ }
|
10
10
|
it { is_expected.to include "\n____\nFirst quoted paragraph\n\nSecond quoted paragraph\n____\n" }
|
11
11
|
|
12
12
|
end
|
@@ -21,7 +21,7 @@ describe ReverseAdoc::Converters::Pre do
|
|
21
21
|
|
22
22
|
it 'preserves xml' do
|
23
23
|
node = node_for("<pre><code>x</code><br/><p>hello</p></pre>")
|
24
|
-
expect(converter.convert(node)).to include "....\n
|
24
|
+
expect(converter.convert(node)).to include "....\nx\n\n\nhello\n\n\n....\n"
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'syntax highlighting' do
|
@@ -28,10 +28,16 @@ describe ReverseAdoc::Converters::Text do
|
|
28
28
|
expect(result).to eq "foo bar "
|
29
29
|
end
|
30
30
|
|
31
|
-
it
|
31
|
+
it "keeps HTML characters" do
|
32
32
|
input = node_for("<p><foo></p>")
|
33
33
|
result = converter.convert(input)
|
34
|
-
expect(result).to eq
|
34
|
+
expect(result).to eq "<foo>"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "escapes Link like characters in text" do
|
38
|
+
input = node_for("<p><<foo>></p>")
|
39
|
+
result = converter.convert(input)
|
40
|
+
expect(result).to eq '\<<foo>>'
|
35
41
|
end
|
36
42
|
|
37
43
|
context 'within backticks' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reverse_adoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: marcel
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.13'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.13'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: codeclimate-test-reporter
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -267,7 +267,7 @@ homepage: http://github.com/metanorma/reverse_adoc
|
|
267
267
|
licenses:
|
268
268
|
- BSD-2-Clause
|
269
269
|
metadata: {}
|
270
|
-
post_install_message:
|
270
|
+
post_install_message:
|
271
271
|
rdoc_options: []
|
272
272
|
require_paths:
|
273
273
|
- lib
|
@@ -275,65 +275,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
275
|
requirements:
|
276
276
|
- - ">="
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version: 2.
|
278
|
+
version: 2.7.0
|
279
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
280
|
requirements:
|
281
281
|
- - ">="
|
282
282
|
- !ruby/object:Gem::Version
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
286
|
-
signing_key:
|
285
|
+
rubygems_version: 3.3.26
|
286
|
+
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
|
289
|
-
test_files:
|
290
|
-
- spec/assets/anchors.html
|
291
|
-
- spec/assets/basic.html
|
292
|
-
- spec/assets/code.html
|
293
|
-
- spec/assets/escapables.html
|
294
|
-
- spec/assets/external_images.docx
|
295
|
-
- spec/assets/external_images.html
|
296
|
-
- spec/assets/from_the_wild.html
|
297
|
-
- spec/assets/full_example.html
|
298
|
-
- spec/assets/html_fragment.html
|
299
|
-
- spec/assets/lists.html
|
300
|
-
- spec/assets/minimum.html
|
301
|
-
- spec/assets/paragraphs.html
|
302
|
-
- spec/assets/quotation.html
|
303
|
-
- spec/assets/tables.html
|
304
|
-
- spec/assets/unknown_tags.html
|
305
|
-
- spec/bin/reverse_adoc_spec.rb
|
306
|
-
- spec/bin/w2a_spec.rb
|
307
|
-
- spec/components/anchors_spec.rb
|
308
|
-
- spec/components/basic_spec.rb
|
309
|
-
- spec/components/code_spec.rb
|
310
|
-
- spec/components/escapables_spec.rb
|
311
|
-
- spec/components/from_the_wild_spec.rb
|
312
|
-
- spec/components/html_fragment_spec.rb
|
313
|
-
- spec/components/lists_spec.rb
|
314
|
-
- spec/components/paragraphs_spec.rb
|
315
|
-
- spec/components/quotation_spec.rb
|
316
|
-
- spec/components/tables_spec.rb
|
317
|
-
- spec/components/unknown_tags_spec.rb
|
318
|
-
- spec/lib/reverse_adoc.rb
|
319
|
-
- spec/lib/reverse_adoc/cleaner_spec.rb
|
320
|
-
- spec/lib/reverse_adoc/config_spec.rb
|
321
|
-
- spec/lib/reverse_adoc/converters/aside_spec.rb
|
322
|
-
- spec/lib/reverse_adoc/converters/audio_spec.rb
|
323
|
-
- spec/lib/reverse_adoc/converters/blockquote_spec.rb
|
324
|
-
- spec/lib/reverse_adoc/converters/br_spec.rb
|
325
|
-
- spec/lib/reverse_adoc/converters/code_spec.rb
|
326
|
-
- spec/lib/reverse_adoc/converters/div_spec.rb
|
327
|
-
- spec/lib/reverse_adoc/converters/figure_spec.rb
|
328
|
-
- spec/lib/reverse_adoc/converters/img_spec.rb
|
329
|
-
- spec/lib/reverse_adoc/converters/li_spec.rb
|
330
|
-
- spec/lib/reverse_adoc/converters/mark_spec.rb
|
331
|
-
- spec/lib/reverse_adoc/converters/p_spec.rb
|
332
|
-
- spec/lib/reverse_adoc/converters/pre_spec.rb
|
333
|
-
- spec/lib/reverse_adoc/converters/q_spec.rb
|
334
|
-
- spec/lib/reverse_adoc/converters/strong_spec.rb
|
335
|
-
- spec/lib/reverse_adoc/converters/text_spec.rb
|
336
|
-
- spec/lib/reverse_adoc/converters/video_spec.rb
|
337
|
-
- spec/lib/reverse_adoc/converters_spec.rb
|
338
|
-
- spec/spec_helper.rb
|
339
|
-
- spec/support/shell_helpers.rb
|
289
|
+
test_files: []
|