asciidoctor 2.0.21 → 2.0.22

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb33ff3290649511b70addaa88b8b1ef9429641bc0cf04113b8fe8613ac6ad63
4
- data.tar.gz: 6c26157b4e3a366c43b2ef6a2fffcad558b3a3363fc3985ca7a1b2412292d192
3
+ metadata.gz: 5c8bf90148c22e9396333d1062352368ea297bd1a63d03c0166e0dde81677989
4
+ data.tar.gz: a9c48ed8d9827acb0b9919b1f6909c1752cd62115b3e6e7e9b552d8a6d7930c6
5
5
  SHA512:
6
- metadata.gz: 72aca517f60e682e3038e8f790669de5e00f86f6b3d20be023b090bff7e837f866e2211e67657ba5139ca9758f9b260ffff70edf597b060d371e2e1ffc09e1e7
7
- data.tar.gz: efcc562d749e9fafc3462598490a9b03a0f556919a55c1fb0c5f04635006ac006800dd6607388bacef5d837aeb7f3d2951ed11069675dae5555b84ce8945bcf3
6
+ metadata.gz: 84f45230cbd9b25b810ef9a369b2c2e769833517fda4197f55f52129b86c6c30b9c4f06d20df20e6abd552a3b12679c123641de35c8d29e6dd3d0d3b511b8185
7
+ data.tar.gz: 0cf0028a60356d0966ff1637e130b285b73d769f7bcf426a31397f9eab8bbe91118d78fa27c303684f0e624dd062980ec5602c931e65272382d079b086ea076f
data/CHANGELOG.adoc CHANGED
@@ -16,6 +16,21 @@ For an even more detailed look at what has changed, refer to the {url-repo}/comm
16
16
  This project utilizes semantic versioning.
17
17
 
18
18
  // tag::compact[]
19
+ == 2.0.22 (2024-03-08) - @mojavelinux
20
+
21
+ Improvements::
22
+
23
+ * Set `cloaked-context` attribute on source block when context is not `:listing` (#4556)
24
+
25
+ Compliance::
26
+
27
+ * Remove use of base64 library to prevent warning in Ruby >= 3.3 (#4561)
28
+
29
+ === Details
30
+
31
+ {url-repo}/releases/tag/v2.0.22[git tag] | {url-repo}/compare/v2.0.21\...v2.0.22[full diff]
32
+ // end::compact[]
33
+
19
34
  == 2.0.21 (2024-02-20) - @mojavelinux
20
35
 
21
36
  Compliance::
@@ -46,7 +61,6 @@ Bug Fixes::
46
61
  === Details
47
62
 
48
63
  {url-repo}/releases/tag/v2.0.21[git tag] | {url-repo}/compare/v2.0.20\...v2.0.21[full diff]
49
- // end::compact[]
50
64
 
51
65
  == 2.0.20 (2023-05-18) - @mojavelinux
52
66
 
data/README-de.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.21, 2024-02-20
3
+ v2.0.22, 2024-03-08
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -16,7 +16,7 @@ ifdef::env-github[]
16
16
  :warning-caption: :warning:
17
17
  endif::[]
18
18
  // Variables:
19
- :release-version: 2.0.21
19
+ :release-version: 2.0.22
20
20
  // URIs:
21
21
  :uri-org: https://github.com/asciidoctor
22
22
  :uri-repo: {uri-org}/asciidoctor
data/README-fr.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.21, 2024-02-20
3
+ v2.0.22, 2024-03-08
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -16,7 +16,7 @@ ifdef::env-github[]
16
16
  :warning-caption: :warning:
17
17
  endif::[]
18
18
  // Variables:
19
- :release-version: 2.0.21
19
+ :release-version: 2.0.22
20
20
  // URIs:
21
21
  :uri-org: https://github.com/asciidoctor
22
22
  :uri-repo: {uri-org}/asciidoctor
data/README-jp.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.21, 2024-02-20
3
+ v2.0.22, 2024-03-08
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -16,7 +16,7 @@ ifdef::env-github[]
16
16
  :warning-caption: :warning:
17
17
  endif::[]
18
18
  // Variables:
19
- :release-version: 2.0.21
19
+ :release-version: 2.0.22
20
20
  // URIs:
21
21
  :uri-org: https://github.com/asciidoctor
22
22
  :uri-repo: {uri-org}/asciidoctor
data/README-zh_CN.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.21, 2024-02-20
3
+ v2.0.22, 2024-03-08
4
4
  // settings:
5
5
  :page-layout: base
6
6
  :idprefix:
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.21
20
+ :release-version: 2.0.22
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.0.21, 2024-02-20
3
+ v2.0.22, 2024-03-08
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -16,7 +16,7 @@ ifdef::env-github[]
16
16
  :warning-caption: :warning:
17
17
  endif::[]
18
18
  // Variables:
19
- :release-version: 2.0.21
19
+ :release-version: 2.0.22
20
20
  // URLs:
21
21
  :url-org: https://github.com/asciidoctor
22
22
  :url-repo: {url-org}/asciidoctor
data/asciidoctor.gemspec CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
39
39
  # erubi is needed for testing alternate eRuby impls
40
40
  s.add_development_dependency 'erubi', '~> 1.10.0'
41
41
  s.add_development_dependency 'haml', '~> 6.1.0'
42
- s.add_development_dependency 'minitest', '~> 5.14.0'
42
+ s.add_development_dependency 'minitest', '~> 5.22.0'
43
43
  s.add_development_dependency 'nokogiri', '~> 1.13.0'
44
44
  s.add_development_dependency 'rake', '~> 12.3.0'
45
45
  s.add_development_dependency 'slim', '~> 4.1.0'
@@ -354,8 +354,8 @@ class AbstractNode
354
354
  #
355
355
  # First, and foremost, the target image path is cleaned if the document safe mode level
356
356
  # is set to at least SafeMode::SAFE (a condition which is true by default) to prevent access
357
- # to ancestor paths in the filesystem. The image data is then read and converted to
358
- # Base64. Finally, a data URI is built which can be used in an image tag.
357
+ # to ancestor paths in the filesystem. The image data is then read and converted to base64.
358
+ # Finally, a data URI is built which can be used in an image tag.
359
359
  #
360
360
  # target_image - A String path to the target image
361
361
  # asset_dir_key - The String attribute key used to lookup the directory where
@@ -376,8 +376,8 @@ class AbstractNode
376
376
  end
377
377
 
378
378
  if ::File.readable? image_path
379
- # NOTE base64 is autoloaded by reference to ::Base64
380
- %(data:#{mimetype};base64,#{::Base64.strict_encode64 ::File.binread image_path})
379
+ # NOTE pack 'm0' is equivalent to Base64.strict_encode64
380
+ %(data:#{mimetype};base64,#{[(::File.binread image_path)].pack 'm0'})
381
381
  else
382
382
  logger.warn %(image to embed not found or not readable: #{image_path})
383
383
  %(data:#{mimetype};base64,)
@@ -410,8 +410,8 @@ class AbstractNode
410
410
 
411
411
  begin
412
412
  mimetype, bindata = ::OpenURI.open_uri(image_uri, URI_READ_MODE) {|f| [f.content_type, f.read] }
413
- # NOTE base64 is autoloaded by reference to ::Base64
414
- %(data:#{mimetype};base64,#{::Base64.strict_encode64 bindata})
413
+ # NOTE pack 'm0' is equivalent to Base64.strict_encode64
414
+ %(data:#{mimetype};base64,#{[bindata].pack 'm0'})
415
415
  rescue
416
416
  logger.warn %(could not retrieve image data from URI: #{image_uri})
417
417
  image_uri
@@ -561,6 +561,7 @@ class Parser
561
561
  # process lines verbatim
562
562
  if style && Compliance.strict_verbatim_paragraphs && (VERBATIM_STYLES.include? style)
563
563
  block_context = style.to_sym
564
+ cloaked_context = :paragraph
564
565
  reader.unshift_line this_line
565
566
  # advance to block parsing =>
566
567
  break
@@ -818,16 +819,17 @@ class Parser
818
819
  unless block
819
820
  case block_context
820
821
  when :listing, :source
821
- if block_context == :source || (!attributes[1] && (language = attributes[2] || doc_attrs['source-language']))
822
- if language
822
+ if block_context == :source || (language = attributes[1] ? nil : attributes[2] || doc_attrs['source-language'])
823
+ if language # :listing
823
824
  attributes['style'] = 'source'
824
825
  attributes['language'] = language
825
826
  AttributeList.rekey attributes, [nil, nil, 'linenums']
826
- else
827
+ else # :source
827
828
  AttributeList.rekey attributes, [nil, 'language', 'linenums']
828
829
  if doc_attrs.key? 'source-language'
829
830
  attributes['language'] = doc_attrs['source-language']
830
831
  end unless attributes.key? 'language'
832
+ attributes['cloaked-context'] = cloaked_context unless cloaked_context == :listing
831
833
  end
832
834
  if attributes['linenums-option'] || doc_attrs['source-linenums-option']
833
835
  attributes['linenums'] = ''
@@ -856,6 +858,7 @@ class Parser
856
858
  else
857
859
  attributes['language'] = language
858
860
  end
861
+ attributes['cloaked-context'] = cloaked_context
859
862
  if attributes['linenums-option'] || doc_attrs['source-linenums-option']
860
863
  attributes['linenums'] = ''
861
864
  end unless attributes.key? 'linenums'
@@ -103,6 +103,7 @@ module Asciidoctor
103
103
  # }
104
104
  # // end::try-catch[]
105
105
  # NOTE m flag is required for Asciidoctor.js
106
+ # NOTE the regex checks for \r to account of include files that use Windows newlines
106
107
  TagDirectiveRx = /\b(?:tag|(e)nd)::(\S+?)\[\](?=$|[ \r])/m
107
108
 
108
109
  ## Attribute entries and references
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
- VERSION = '2.0.21'
3
+ VERSION = '2.0.22'
4
4
  end
data/lib/asciidoctor.rb CHANGED
@@ -6,7 +6,6 @@ if RUBY_ENGINE == 'opal'
6
6
  # this require is satisfied by the Asciidoctor.js build; it augments the Ruby environment for Asciidoctor.js
7
7
  require 'asciidoctor/js'
8
8
  else
9
- autoload :Base64, 'base64'
10
9
  require 'cgi/util'
11
10
  autoload :OpenURI, 'open-uri'
12
11
  autoload :Pathname, 'pathname'
@@ -209,13 +208,13 @@ module Asciidoctor
209
208
  BOM_BYTES_UTF_16BE = [0xfe, 0xff]
210
209
 
211
210
  # The mode to use when opening a file for reading
212
- FILE_READ_MODE = RUBY_ENGINE_OPAL ? 'r' : 'rb:utf-8:utf-8'
211
+ FILE_READ_MODE = RUBY_ENGINE_OPAL ? 'r' : 'rb:UTF-8:UTF-8'
213
212
 
214
213
  # The mode to use when opening a URI for reading
215
214
  URI_READ_MODE = FILE_READ_MODE
216
215
 
217
216
  # The mode to use when opening a file for writing
218
- FILE_WRITE_MODE = RUBY_ENGINE_OPAL ? 'w' : 'wb:utf-8'
217
+ FILE_WRITE_MODE = RUBY_ENGINE_OPAL ? 'w' : 'wb:UTF-8'
219
218
 
220
219
  # The default document type
221
220
  # Can influence markup generated by the converters
data/man/asciidoctor.1 CHANGED
@@ -1,13 +1,13 @@
1
1
  '\" t
2
2
  .\" Title: asciidoctor
3
3
  .\" Author: Dan Allen, Sarah White
4
- .\" Generator: Asciidoctor 2.0.20
4
+ .\" Generator: Asciidoctor 2.0.21
5
5
  .\" Date: 2018-03-20
6
6
  .\" Manual: Asciidoctor Manual
7
- .\" Source: Asciidoctor 2.0.21
7
+ .\" Source: Asciidoctor 2.0.22
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.21" "Asciidoctor Manual"
10
+ .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.22" "Asciidoctor Manual"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
data/man/asciidoctor.adoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = asciidoctor(1)
2
2
  Dan Allen; Sarah White
3
3
  :doctype: manpage
4
- :release-version: 2.0.21
4
+ :release-version: 2.0.22
5
5
  :man manual: Asciidoctor Manual
6
6
  :man source: Asciidoctor {release-version}
7
7
  ifdef::backend-manpage[:!author:]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.21
4
+ version: 2.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -77,14 +77,14 @@ dependencies:
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 5.14.0
80
+ version: 5.22.0
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 5.14.0
87
+ version: 5.22.0
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: nokogiri
90
90
  requirement: !ruby/object:Gem::Requirement