asciidoctor 2.0.2 → 2.0.3

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: b2de6beb8308df8a84bde4b59be99d0d9d41474735279c6aaf6e6e76821d4bb6
4
- data.tar.gz: 709d4f1eb62a388ef5e1e5c7991c024c126112894d842185f7ae2fdc8fbe924d
3
+ metadata.gz: b387fa0771edae16b11f32ee1bf6024ecf631fb59fb3dc4835e96cd7a73627d4
4
+ data.tar.gz: 9d5d7513e9a45f12e642ed2d909f996c6105186b81d8f5ac9f074ec5e2adafd9
5
5
  SHA512:
6
- metadata.gz: 5bac9d6c955c94dc8425ad7dc54706e3988e516cd156554d11ed1e1a85f4a8d77087bd2fbb407a630c547446dfbb6324c4a1babd226c144eee8df0c9ddd52e60
7
- data.tar.gz: 7405db9ddcd871c6615862dc7bf0af440acca9b4120accdbd05493735b8de8c012a163dbaf731c074c8cfcc21c496d40e610e4aaaeb55aeba6613ef1941f06c6
6
+ metadata.gz: b8a178dbd99edc2076c7daa473096719b65076c50d9741b0f298b95b643a4c0f80a1b587f1f74afffb14af4698007231e4eda02a269dfe581e9c22095136c647
7
+ data.tar.gz: d7a65f4d9e6190ab23e7dc6b8fd09adedf4bc2eb8f45922930450b0fc05277b31eb9ee854bbbce92746d5f568b84cd3973381765ffba2016467d9738bf8305ff
@@ -13,6 +13,13 @@ endif::[]
13
13
  This document provides a high-level view of the changes introduced in Asciidoctor by release.
14
14
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
15
15
 
16
+ == 2.0.3 (2019-03-28) - @mojavelinux
17
+
18
+ Bug Fixes::
19
+
20
+ * fix crash when attrlist is used on literal monospace phrase (#3216)
21
+ * update use of magic regexp variables to fix compatibility with Opal / Asciidoctor.js (#3214)
22
+
16
23
  == 2.0.2 (2019-03-26) - @mojavelinux
17
24
 
18
25
  Bug Fixes::
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.2, 2019-03-26
3
+ v2.0.3, 2019-03-28
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.2
20
+ :release-version: 2.0.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.2, 2019-03-26
3
+ v2.0.3, 2019-03-28
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.2
20
+ :release-version: 2.0.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.2, 2019-03-26
3
+ v2.0.3, 2019-03-28
4
4
  // settings:
5
5
  :page-layout: base
6
6
  :idprefix:
@@ -18,7 +18,7 @@ ifdef::env-github[]
18
18
  :warning-caption: :warning:
19
19
  endif::[]
20
20
  // Variables:
21
- :release-version: 2.0.2
21
+ :release-version: 2.0.3
22
22
  // URIs:
23
23
  :uri-org: https://github.com/asciidoctor
24
24
  :uri-repo: {uri-org}/asciidoctor
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.2, 2019-03-26
3
+ v2.0.3, 2019-03-28
4
4
  // settings:
5
5
  :page-layout: base
6
6
  :idprefix:
@@ -18,7 +18,7 @@ ifdef::env-github[]
18
18
  :warning-caption: :warning:
19
19
  endif::[]
20
20
  // Variables:
21
- :release-version: 2.0.2
21
+ :release-version: 2.0.3
22
22
  // URIs:
23
23
  :uri-org: https://github.com/asciidoctor
24
24
  :uri-repo: {uri-org}/asciidoctor
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.2, 2019-03-26
3
+ v2.0.3, 2019-03-28
4
4
  // settings:
5
5
  :idprefix:
6
6
  :idseparator: -
@@ -17,7 +17,7 @@ ifdef::env-github[]
17
17
  :warning-caption: :warning:
18
18
  endif::[]
19
19
  // Variables:
20
- :release-version: 2.0.2
20
+ :release-version: 2.0.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -293,7 +293,8 @@ module Asciidoctor
293
293
  DELIMITED_BLOCK_HEADS = {}.tap {|accum| DELIMITED_BLOCKS.each_key {|k| accum[k.slice 0, 2] = true } }
294
294
  DELIMITED_BLOCK_TAILS = {}.tap {|accum| DELIMITED_BLOCKS.each_key {|k| accum[k] = k[k.length - 1] if k.length == 4 } }
295
295
 
296
- CAPTION_ATTR_NAMES = { example: 'example-caption', image: 'figure-caption', listing: 'listing-caption', table: 'table-caption' }
296
+ # NOTE the 'figure' key as a string is historical and used by image blocks
297
+ CAPTION_ATTR_NAMES = { example: 'example-caption', 'figure' => 'figure-caption', listing: 'listing-caption', table: 'table-caption' }
297
298
 
298
299
  LAYOUT_BREAK_CHARS = {
299
300
  '\'' => :thematic_break,
@@ -378,8 +378,7 @@ class AbstractBlock < AbstractNode
378
378
  def assign_caption value = nil, caption_context = @context
379
379
  unless @caption || !@title || (@caption = value || @document.attributes['caption'])
380
380
  if (attr_name = CAPTION_ATTR_NAMES[caption_context]) && (prefix = @document.attributes[attr_name])
381
- counter_name = caption_context == :image ? 'figure-number' : %(#{caption_context}-number)
382
- @caption = %(#{prefix} #{@numeral = @document.increment_and_store_counter counter_name, self}. )
381
+ @caption = %(#{prefix} #{@numeral = @document.increment_and_store_counter %(#{caption_context}-number), self}. )
383
382
  nil
384
383
  end
385
384
  end
@@ -740,9 +740,10 @@ class Converter::DocBook5Converter < Converter::Base
740
740
  width_attr = ''
741
741
  depth_attr = ''
742
742
  if (cover_image.include? ':') && ImageMacroRx =~ cover_image
743
+ attrlist = $2
743
744
  cover_image = doc.image_uri $1
744
- unless $2.empty?
745
- attrs = (AttributeList.new $2).parse ['alt', 'width', 'height']
745
+ unless attrlist.empty?
746
+ attrs = (AttributeList.new attrlist).parse ['alt', 'width', 'height']
746
747
  if attrs.key? 'scaledwidth'
747
748
  # NOTE scalefit="1" is the default in this case
748
749
  width_attr = %( width="#{attrs['scaledwidth']}")
@@ -1102,7 +1102,8 @@ class Document < AbstractBlock
1102
1102
  # Returns The String value with substitutions performed
1103
1103
  def apply_attribute_value_subs value
1104
1104
  if AttributeEntryPassMacroRx =~ value
1105
- value = $1 ? (apply_subs $2, (resolve_pass_subs $1)) : $2
1105
+ value = $2
1106
+ value = apply_subs value, (resolve_pass_subs $1) if $1
1106
1107
  else
1107
1108
  value = apply_header_subs value
1108
1109
  end
@@ -197,7 +197,7 @@ module Extensions
197
197
  block = create_block parent, :image, nil, attrs, opts
198
198
  if title
199
199
  block.title = title
200
- block.assign_caption (attrs.delete 'caption'), (opts[:caption_context] || :image)
200
+ block.assign_caption (attrs.delete 'caption'), 'figure'
201
201
  end
202
202
  block
203
203
  end
@@ -605,7 +605,7 @@ class Parser
605
605
  end
606
606
  if attributes['title']
607
607
  block.title = block_title = attributes.delete 'title'
608
- block.assign_caption (attributes.delete 'caption')
608
+ block.assign_caption (attributes.delete 'caption'), 'figure'
609
609
  end
610
610
  end
611
611
  attributes['target'] = target
@@ -955,8 +955,11 @@ class PreprocessorReader < Reader
955
955
  if no_target
956
956
  # the text in brackets must match a conditional expression
957
957
  if text && EvalExpressionRx =~ text.strip
958
+ lhs = $1
959
+ op = $2
960
+ rhs = $3
958
961
  # regex enforces a restricted set of math-related operations (==, !=, <=, >=, <, >)
959
- skip = ((resolve_expr_val $1).send $2, (resolve_expr_val $3)) ? false : true
962
+ skip = ((resolve_expr_val lhs).send op, (resolve_expr_val rhs)) ? false : true
960
963
  else
961
964
  logger.error message_with_context %(malformed preprocessor directive - #{text ? 'invalid expression' : 'missing expression'}: ifeval::[#{text}]), source_location: cursor
962
965
  return true
@@ -308,7 +308,7 @@ module Substitutors
308
308
  extensions.inline_macros.each do |extension|
309
309
  text = text.gsub extension.instance.regexp do
310
310
  # honor the escape
311
- next $&.slice 1, $&.length if $&.start_with? RS
311
+ next $&.slice 1, $&.length if (match = $&).start_with? RS
312
312
  if $~.names.empty?
313
313
  target, content = $1, $2
314
314
  else
@@ -336,7 +336,7 @@ module Substitutors
336
336
  end
337
337
  replacement.convert
338
338
  elsif replacement
339
- logger.info %(expected substitution value for custom inline macro to be of type Inline; got #{replacement.class}: #{$&})
339
+ logger.info %(expected substitution value for custom inline macro to be of type Inline; got #{replacement.class}: #{match})
340
340
  replacement
341
341
  else
342
342
  ''
@@ -691,11 +691,11 @@ module Substitutors
691
691
  # honor the escape
692
692
  next $1 == RS ? ($&.slice 1, $&.length) : $& if $1
693
693
 
694
- target = 'mailto:' + $&
694
+ target = 'mailto:' + (address = $&)
695
695
  # QUESTION should this be registered as an e-mail address?
696
696
  doc.register(:links, target)
697
697
 
698
- Inline.new(self, :anchor, $&, type: :link, target: target).convert
698
+ Inline.new(self, :anchor, address, type: :link, target: target).convert
699
699
  end
700
700
  end
701
701
 
@@ -906,7 +906,7 @@ module Substitutors
906
906
  # honor the escape
907
907
  if $2
908
908
  # use sub since it might be behind a line comment
909
- $&.sub(RS, '')
909
+ $&.sub RS, ''
910
910
  else
911
911
  Inline.new(self, :callout, $4 == '.' ? (autonum += 1).to_s : $4, id: @document.callouts.read_next_id, attributes: { 'guard' => $1 }).convert
912
912
  end
@@ -1000,30 +1000,22 @@ module Substitutors
1000
1000
  text = text.gsub InlinePassMacroRx do
1001
1001
  if (boundary = $4) # $$, ++, or +++
1002
1002
  # skip ++ in compat mode, handled as normal quoted text
1003
- if compat_mode && boundary == '++'
1004
- content = extract_passthroughs $5
1005
- next $2 ? %(#{$1}[#{$2}]#{$3}++#{content}++) : %(#{$1}#{$3}++#{content}++)
1006
- end
1007
-
1008
- attributes = $2
1009
- escape_count = $3.length
1010
- content = $5
1003
+ next %(#{$2 ? "#{$1}[#{$2}]#{$3}" : "#{$1}#{$3}"}++#{extract_passthroughs $5}++) if compat_mode && boundary == '++'
1011
1004
 
1012
- if attributes
1013
- if escape_count > 0
1005
+ if (attrlist = $2)
1006
+ if (escape_count = $3.length) > 0
1014
1007
  # NOTE we don't look for nested unconstrained pass macros
1015
- next %(#{$1}[#{attributes}]#{RS * (escape_count - 1)}#{boundary}#{$5}#{boundary})
1008
+ next %(#{$1}[#{attrlist}]#{RS * (escape_count - 1)}#{boundary}#{$5}#{boundary})
1016
1009
  elsif $1 == RS
1017
- preceding = %([#{attributes}])
1018
- attributes = nil
1010
+ preceding = %([#{attrlist}])
1019
1011
  else
1020
- if boundary == '++' && (attributes.end_with? 'x-')
1012
+ if boundary == '++' && (attrlist.end_with? 'x-')
1021
1013
  old_behavior = true
1022
- attributes = attributes.slice 0, attributes.length - 2
1014
+ attrlist = attrlist.slice 0, attrlist.length - 2
1023
1015
  end
1024
- attributes = parse_quoted_text_attributes attributes
1016
+ attributes = parse_quoted_text_attributes attrlist
1025
1017
  end
1026
- elsif escape_count > 0
1018
+ elsif (escape_count = $3.length) > 0
1027
1019
  # NOTE we don't look for nested unconstrained pass macros
1028
1020
  next %(#{RS * (escape_count - 1)}#{boundary}#{$5}#{boundary})
1029
1021
  end
@@ -1031,18 +1023,22 @@ module Substitutors
1031
1023
 
1032
1024
  if attributes
1033
1025
  if old_behavior
1034
- passthrus[passthru_key = passthrus.size] = { text: content, subs: NORMAL_SUBS, type: :monospaced, attributes: attributes }
1026
+ passthrus[passthru_key = passthrus.size] = { text: $5, subs: NORMAL_SUBS, type: :monospaced, attributes: attributes }
1035
1027
  else
1036
- passthrus[passthru_key = passthrus.size] = { text: content, subs: subs, type: :unquoted, attributes: attributes }
1028
+ passthrus[passthru_key = passthrus.size] = { text: $5, subs: subs, type: :unquoted, attributes: attributes }
1037
1029
  end
1038
1030
  else
1039
- passthrus[passthru_key = passthrus.size] = { text: content, subs: subs }
1031
+ passthrus[passthru_key = passthrus.size] = { text: $5, subs: subs }
1040
1032
  end
1041
1033
  else # pass:[]
1042
1034
  # NOTE we don't look for nested pass:[] macros
1043
1035
  # honor the escape
1044
1036
  next $&.slice 1, $&.length if $6 == RS
1045
- passthrus[passthru_key = passthrus.size] = { text: (normalize_text $8, nil, true), subs: ($7 ? (resolve_pass_subs $7) : nil) }
1037
+ if (subs = $7)
1038
+ passthrus[passthru_key = passthrus.size] = { text: (normalize_text $8, nil, true), subs: (resolve_pass_subs subs) }
1039
+ else
1040
+ passthrus[passthru_key = passthrus.size] = { text: (normalize_text $8, nil, true) }
1041
+ end
1046
1042
  end
1047
1043
 
1048
1044
  %(#{preceding || ''}#{PASS_START}#{passthru_key}#{PASS_END})
@@ -1051,29 +1047,28 @@ module Substitutors
1051
1047
  pass_inline_char1, pass_inline_char2, pass_inline_rx = InlinePassRx[compat_mode]
1052
1048
  text = text.gsub pass_inline_rx do
1053
1049
  preceding = $1
1054
- attributes = $2
1050
+ attrlist = $2
1055
1051
  escape_mark = RS if (quoted_text = $3).start_with? RS
1056
1052
  format_mark = $4
1057
1053
  content = $5
1058
1054
 
1059
1055
  if compat_mode
1060
1056
  old_behavior = true
1061
- elsif (old_behavior = attributes && (attributes.end_with? 'x-'))
1062
- attributes = attributes.slice 0, attributes.length - 2
1057
+ elsif (old_behavior = attrlist && (attrlist.end_with? 'x-'))
1058
+ attrlist = attrlist.slice 0, attrlist.length - 2
1063
1059
  end
1064
1060
 
1065
- if attributes
1061
+ if attrlist
1066
1062
  if format_mark == '`' && !old_behavior
1067
- next extract_inner_passthrough content, %(#{preceding}[#{attributes}]#{escape_mark}), attributes
1063
+ next extract_inner_passthrough content, %(#{preceding}[#{attrlist}]#{escape_mark})
1068
1064
  elsif escape_mark
1069
1065
  # honor the escape of the formatting mark
1070
- next %(#{preceding}[#{attributes}]#{quoted_text.slice 1, quoted_text.length})
1066
+ next %(#{preceding}[#{attrlist}]#{quoted_text.slice 1, quoted_text.length})
1071
1067
  elsif preceding == RS
1072
1068
  # honor the escape of the attributes
1073
- preceding = %([#{attributes}])
1074
- attributes = nil
1069
+ preceding = %([#{attrlist}])
1075
1070
  else
1076
- attributes = parse_quoted_text_attributes attributes
1071
+ attributes = parse_quoted_text_attributes attrlist
1077
1072
  end
1078
1073
  elsif format_mark == '`' && !old_behavior
1079
1074
  next extract_inner_passthrough content, %(#{preceding}#{escape_mark})
@@ -1106,10 +1101,11 @@ module Substitutors
1106
1101
  if (type = $1.to_sym) == :stem
1107
1102
  type = STEM_TYPE_ALIASES[@document.attributes['stem']].to_sym
1108
1103
  end
1104
+ subs = $2
1109
1105
  content = normalize_text $3, nil, true
1110
1106
  # NOTE drop enclosing $ signs around latexmath for backwards compatibility with AsciiDoc Python
1111
1107
  content = content.slice 1, content.length - 2 if type == :latexmath && (content.start_with? '$') && (content.end_with? '$')
1112
- subs = $2 ? (resolve_pass_subs $2) : ((@document.basebackend? 'html') ? BASIC_SUBS : nil)
1108
+ subs = subs ? (resolve_pass_subs subs) : ((@document.basebackend? 'html') ? BASIC_SUBS : nil)
1113
1109
  passthrus[passthru_key = passthrus.size] = { text: content, subs: subs, type: type }
1114
1110
  %(#{PASS_START}#{passthru_key}#{PASS_END})
1115
1111
  end if (text.include? ':') && ((text.include? 'stem:') || (text.include? 'math:'))
@@ -1371,14 +1367,12 @@ module Substitutors
1371
1367
  end
1372
1368
 
1373
1369
  # Internal: Extract nested single-plus passthrough; otherwise return unprocessed
1374
- def extract_inner_passthrough text, pre, attributes = nil
1370
+ def extract_inner_passthrough text, pre
1375
1371
  if (text.end_with? '+') && (text.start_with? '+', '\+') && SinglePlusInlinePassRx =~ text
1376
1372
  if $1
1377
1373
  %(#{pre}`+#{$2}+`)
1378
1374
  else
1379
- @passthroughs[passthru_key = @passthroughs.size] = attributes ?
1380
- { text: $2, subs: BASIC_SUBS, attributes: attributes, type: :unquoted } :
1381
- { text: $2, subs: BASIC_SUBS }
1375
+ @passthroughs[passthru_key = @passthroughs.size] = { text: $2, subs: BASIC_SUBS }
1382
1376
  %(#{pre}`#{PASS_START}#{passthru_key}#{PASS_END}`)
1383
1377
  end
1384
1378
  else
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Asciidoctor
3
- VERSION = '2.0.2'
3
+ VERSION = '2.0.3'
4
4
  end
@@ -1,13 +1,13 @@
1
1
  '\" t
2
2
  .\" Title: asciidoctor
3
3
  .\" Author: Dan Allen, Sarah White, Ryan Waldron
4
- .\" Generator: Asciidoctor 2.0.2
5
- .\" Date: 2019-03-26
4
+ .\" Generator: Asciidoctor 2.0.3
5
+ .\" Date: 2019-03-28
6
6
  .\" Manual: Asciidoctor Manual
7
- .\" Source: Asciidoctor 2.0.2
7
+ .\" Source: Asciidoctor 2.0.3
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "ASCIIDOCTOR" "1" "2019-03-26" "Asciidoctor 2.0.2" "Asciidoctor Manual"
10
+ .TH "ASCIIDOCTOR" "1" "2019-03-28" "Asciidoctor 2.0.3" "Asciidoctor Manual"
11
11
  .ie \n(.g .ds Aq \(aq
12
12
  .el .ds Aq '
13
13
  .ss \n[.ss] 0
@@ -2,7 +2,7 @@
2
2
  Dan Allen; Sarah White; Ryan Waldron
3
3
  :doctype: manpage
4
4
  :man manual: Asciidoctor Manual
5
- :man source: Asciidoctor 2.0.2
5
+ :man source: Asciidoctor 2.0.3
6
6
  :page-layout: base
7
7
 
8
8
  == NAME
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.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2019-03-26 00:00:00.000000000 Z
16
+ date: 2019-03-28 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: asciimath