asciidoctor 2.0.22 → 2.0.23

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: 5c8bf90148c22e9396333d1062352368ea297bd1a63d03c0166e0dde81677989
4
- data.tar.gz: a9c48ed8d9827acb0b9919b1f6909c1752cd62115b3e6e7e9b552d8a6d7930c6
3
+ metadata.gz: 3b1c9cee03ccdf7fcc1d1aee9e9d934863d55065c673781d6113d93627ba16de
4
+ data.tar.gz: 582869ca4932e3b58d9ed0c45a7bb2f555a660e0b691090858768f0353be036a
5
5
  SHA512:
6
- metadata.gz: 84f45230cbd9b25b810ef9a369b2c2e769833517fda4197f55f52129b86c6c30b9c4f06d20df20e6abd552a3b12679c123641de35c8d29e6dd3d0d3b511b8185
7
- data.tar.gz: 0cf0028a60356d0966ff1637e130b285b73d769f7bcf426a31397f9eab8bbe91118d78fa27c303684f0e624dd062980ec5602c931e65272382d079b086ea076f
6
+ metadata.gz: 0757a8709e9278d7f5a6eaf0fdfd55001a336f110cad837ebdb2bf2918c9288703d9f4073ebb7e88ffd76532f8472c250191c7a81a0a821f055ac55b4d5e5965
7
+ data.tar.gz: 2ff7be04f59f2431d5d0da01c5fe792d089f1a53c72f6a166c3e6dd274ff17eddebcc39c66d4479047885033da48798c125906d3c7453dd950d60751d04d271f
data/CHANGELOG.adoc CHANGED
@@ -16,6 +16,30 @@ 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.23 (2024-05-17) - @mojavelinux
20
+
21
+ Compliance::
22
+
23
+ * Encode spaces in mailto links as %20, in accordance with RFC 3986, instead of + (#4576)
24
+
25
+ Improvements::
26
+
27
+ * Log error when an incomplete row is detected at the end of a table (#4573)
28
+
29
+ Bug Fixes::
30
+
31
+ * Don't leave behind empty line inside skipped preprocessor conditional (#4580)
32
+ * Don't duplicate block attribute line above detached block that breaks a dlist; fixes duplicate role on detached block (#4565)
33
+ * Don't crash when parsing xref shorthand if target starts with URL protocol and text is offset by space (#4570)
34
+ * Only drop current row if colspan of last cell exceeds specified number of columns (#4587)
35
+ * Drop last row if colspan of last cell in table exceeds specified number of columns (#4587)
36
+ * Preserve repeating spaces in verbatim content in manpage output (#3583)
37
+
38
+ === Details
39
+
40
+ {url-repo}/releases/tag/v2.0.23[git tag] | {url-repo}/compare/v2.0.22\...v2.0.23[full diff]
41
+ // end::compact[]
42
+
19
43
  == 2.0.22 (2024-03-08) - @mojavelinux
20
44
 
21
45
  Improvements::
@@ -29,7 +53,6 @@ Compliance::
29
53
  === Details
30
54
 
31
55
  {url-repo}/releases/tag/v2.0.22[git tag] | {url-repo}/compare/v2.0.21\...v2.0.22[full diff]
32
- // end::compact[]
33
56
 
34
57
  == 2.0.21 (2024-02-20) - @mojavelinux
35
58
 
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.22, 2024-03-08
3
+ v2.0.23, 2024-05-17
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.22
19
+ :release-version: 2.0.23
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.22, 2024-03-08
3
+ v2.0.23, 2024-05-17
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.22
19
+ :release-version: 2.0.23
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.22, 2024-03-08
3
+ v2.0.23, 2024-05-17
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.22
19
+ :release-version: 2.0.23
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.22, 2024-03-08
3
+ v2.0.23, 2024-05-17
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.22
20
+ :release-version: 2.0.23
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.22, 2024-03-08
3
+ v2.0.23, 2024-05-17
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.22
19
+ :release-version: 2.0.23
20
20
  // URLs:
21
21
  :url-org: https://github.com/asciidoctor
22
22
  :url-repo: {url-org}/asciidoctor
@@ -130,7 +130,7 @@ If you're using AsciiDoc.py, see {url-docs}/asciidoctor/latest/migrate/asciidoc-
130
130
 
131
131
  Asciidoctor works on Linux, macOS and Windows and requires one of the following implementations of {url-ruby}[Ruby]:
132
132
 
133
- * CRuby (aka MRI) 2.3 - 3.2
133
+ * CRuby (aka MRI) 2.3 - 3.3
134
134
  * JRuby 9.1 - 9.4
135
135
  * TruffleRuby (GraalVM)
136
136
 
@@ -699,7 +699,7 @@ allbox tab(:);'
699
699
  def manify str, opts = {}
700
700
  case opts.fetch :whitespace, :collapse
701
701
  when :preserve
702
- str = str.gsub TAB, ET
702
+ str = (str.gsub TAB, ET).gsub(/(^)? +/) { $1 ? $& : %(#{ESC_BS}&#{$&}) }
703
703
  when :normalize
704
704
  str = str.gsub WrappedIndentRx, LF
705
705
  else
@@ -145,10 +145,13 @@ module Helpers
145
145
  })
146
146
  )
147
147
  end
148
+ elsif (CGI = ::CGI).respond_to? :escapeURIComponent
149
+ def encode_uri_component str
150
+ CGI.escapeURIComponent str
151
+ end
148
152
  else
149
- CGI = ::CGI
150
153
  def encode_uri_component str
151
- CGI.escape str
154
+ (CGI.escape str).gsub '+', '%20'
152
155
  end
153
156
  end
154
157
 
@@ -1476,6 +1476,7 @@ class Parser
1476
1476
  break
1477
1477
  end
1478
1478
  if interrupt
1479
+ this_line = nil
1479
1480
  reader.unshift_lines block_attribute_lines
1480
1481
  break
1481
1482
  end
@@ -2413,6 +2414,7 @@ class Parser
2413
2414
  end
2414
2415
  end
2415
2416
 
2417
+ parser_ctx.close_table
2416
2418
  table.assign_column_widths unless (table.attributes['colcount'] ||= table.columns.size) == 0 || explicit_colspecs
2417
2419
  table.has_header_option = true if implicit_header
2418
2420
  table.partition_header_footer attributes
@@ -820,6 +820,10 @@ class PreprocessorReader < Reader
820
820
  return line unless @process_lines
821
821
 
822
822
  if line.empty?
823
+ if @skipping
824
+ shift
825
+ return
826
+ end
823
827
  @look_ahead += 1
824
828
  return line
825
829
  end
@@ -519,7 +519,12 @@ module Asciidoctor
519
519
  # "https://github.com[]"
520
520
  # (https://github.com) <= parenthesis not included in autolink
521
521
  #
522
- InlineLinkRx = %r((^|link:|#{CG_BLANK}|\\?&lt;()|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|\2([^\s]*?)&gt;|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))m
522
+ if RUBY_ENGINE == 'opal'
523
+ # NOTE In JavaScript, a back reference succeeds if not set; invert the logic to give it a match to refute
524
+ InlineLinkRx = %r((^|link:|#{CG_BLANK}|\\?&lt;(?=\\?(?:https?|file|ftp|irc)(:))|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|(?!\2)([^\s]+?)&gt;|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))
525
+ else
526
+ InlineLinkRx = %r((^|link:|#{CG_BLANK}|\\?&lt;()|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|\2([^\s]+?)&gt;|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))m
527
+ end
523
528
 
524
529
  # Match a link or e-mail inline macro.
525
530
  #
@@ -537,9 +537,8 @@ module Substitutors
537
537
  # honor the escapes
538
538
  next $&.slice 1, $&.length if $1.start_with? RS
539
539
  next %(#{$1}#{$&.slice $1.length + 1, $&.length}) if $3.start_with? RS
540
- target = $3 + $6
541
- next $& if target == $3
542
- doc.register :links, target
540
+ next $& unless $6
541
+ doc.register :links, (target = $3 + $6)
543
542
  link_text = (doc_attrs.key? 'hide-uri-scheme') ? (target.sub UriSniffRx, '') : target
544
543
  (Inline.new self, :anchor, link_text, type: :link, target: target, attributes: { 'role' => 'bare' }).convert
545
544
  else
@@ -300,7 +300,7 @@ class Table::Cell < AbstractBlock
300
300
  # QUESTION is is faster to check for :: before splitting?
301
301
  inner_document_lines = cell_text.split LF, -1
302
302
  if (unprocessed_line1 = inner_document_lines[0]).include? '::'
303
- preprocessed_lines = (PreprocessorReader.new @document, [unprocessed_line1]).readlines
303
+ preprocessed_lines = (PreprocessorReader.new @document, [unprocessed_line1], inner_document_cursor).readlines
304
304
  unless unprocessed_line1 == preprocessed_lines[0] && preprocessed_lines.size < 2
305
305
  inner_document_lines.shift
306
306
  inner_document_lines.unshift(*preprocessed_lines) unless preprocessed_lines.empty?
@@ -659,36 +659,43 @@ class Table::ParserContext
659
659
  end
660
660
  end
661
661
  else
662
- # QUESTION is this right for cells that span columns?
663
- unless (column = @table.columns[@current_row.size])
664
- logger.error message_with_context 'dropping cell because it exceeds specified number of columns', source_location: @reader.cursor_before_mark
665
- return nil
666
- end
662
+ column = @table.columns[@current_row.size]
667
663
  end
668
664
 
669
- cell = Table::Cell.new(column, cell_text, cellspec, cursor: @reader.cursor_before_mark)
665
+ cell = Table::Cell.new column, cell_text, cellspec, cursor: (cursor_before_mark = @reader.cursor_before_mark)
670
666
  @reader.mark
671
667
  unless !cell.rowspan || cell.rowspan == 1
672
668
  activate_rowspan(cell.rowspan, (cell.colspan || 1))
673
669
  end
674
670
  @column_visits += (cell.colspan || 1)
675
671
  @current_row << cell
676
- # don't close the row if we're on the first line and the column count has not been set explicitly
677
- # TODO perhaps the colcount/linenum logic should be in end_of_row? (or a should_end_row? method)
678
- close_row if end_of_row? && (@colcount != -1 || @linenum > 0 || (eol && i == repeat))
672
+ if (row_status = end_of_row?) > -1 && (@colcount != -1 || @linenum > 0 || (eol && i == repeat))
673
+ if row_status > 0
674
+ logger.error message_with_context 'dropping cell because it exceeds specified number of columns', source_location: cursor_before_mark
675
+ close_row true
676
+ else
677
+ close_row
678
+ end
679
+ end
679
680
  end
680
681
  @cell_open = false
681
682
  nil
682
683
  end
683
684
 
685
+ def close_table
686
+ return if @column_visits == 0
687
+ logger.error message_with_context 'dropping cells from incomplete row detected end of table', source_location: @reader.cursor_before_mark
688
+ nil
689
+ end
690
+
684
691
  private
685
692
 
686
693
  # Internal: Close the row by adding it to the Table and resetting the row
687
694
  # Array and counter variables.
688
695
  #
689
696
  # returns nothing
690
- def close_row
691
- @table.rows.body << @current_row
697
+ def close_row drop = false
698
+ @table.rows.body << @current_row unless drop
692
699
  # don't have to account for active rowspans here
693
700
  # since we know this is first row
694
701
  @colcount = @column_visits if @colcount == -1
@@ -709,8 +716,10 @@ class Table::ParserContext
709
716
  end
710
717
 
711
718
  # Internal: Check whether we've met the number of effective columns for the current row.
719
+ #
720
+ # returns -1 if not at end of row, 0 if exactly at end of row, and 1 if overruns end of row
712
721
  def end_of_row?
713
- @colcount == -1 || effective_column_visits == @colcount
722
+ @colcount == -1 ? 0 : effective_column_visits <=> @colcount
714
723
  end
715
724
 
716
725
  # Internal: Calculate the effective column visits, which consists of the number of
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
- VERSION = '2.0.22'
3
+ VERSION = '2.0.23'
4
4
  end
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.21
4
+ .\" Generator: Asciidoctor 2.0.22
5
5
  .\" Date: 2018-03-20
6
6
  .\" Manual: Asciidoctor Manual
7
- .\" Source: Asciidoctor 2.0.22
7
+ .\" Source: Asciidoctor 2.0.23
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.22" "Asciidoctor Manual"
10
+ .TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.23" "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.22
4
+ :release-version: 2.0.23
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.22
4
+ version: 2.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  - !ruby/object:Gem::Version
273
273
  version: '0'
274
274
  requirements: []
275
- rubygems_version: 3.5.3
275
+ rubygems_version: 3.5.9
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: An implementation of the AsciiDoc text processor and publishing toolchain