asciidoctor 2.0.0.rc.2 → 2.0.0.rc.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f340fd25a88b03b8039dc09623ce2d043d30e78a09c84519e9e8ffb59f7f9217
4
- data.tar.gz: e7b1550ffe98c8ccf086eb9ce2b41c2a7f32a9946d34ba5b2a647af0d7887248
3
+ metadata.gz: 5c6f979786009b69e2cc868e90f1b97a7a62cf7906b6071bba4f7de471230df4
4
+ data.tar.gz: b117e749de44c5f099b1f40967165cd6c9792e895ca31fa51b654d87c4c7811f
5
5
  SHA512:
6
- metadata.gz: 0ee1db87cdc03978ab1b20097ec44cc7151df771f6b9b434a2432bb6efc280079c4820164d039a5b04fc24351cb022d376d193628c5f673f5cc458d6e1c83a78
7
- data.tar.gz: 696401edc7d556b9e1070ec1bd74cffcda8747b61a896d46b7c5cf521a35b6cf3925ed78809e8032babe293ca62cf281087e44a6ea21a03f5d1d24e32604bfcf
6
+ metadata.gz: 0a04640a9791301a5007acfcb70c3ed8daaeef605ed1c7e315ee85ba5bca717d7df52dec82870a73aa2d5d84fc6d30d0abe7f9146592b089d2c41bb21e81fe4a
7
+ data.tar.gz: 7b7ed4a9107ee200c447c69452b371049d6ea12cd36b2c4b29e3bab752ed2e1f1db24ec741971840a2bb4d2463da5802013f073bbd8ebea2a0885d8fe07f4edb
data/CHANGELOG.adoc CHANGED
@@ -13,7 +13,7 @@ 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.0.rc.2 (2019-03-12) - @mojavelinux
16
+ == 2.0.0.rc.3 (2019-03-21) - @mojavelinux
17
17
 
18
18
  Enhancements / Compliance::
19
19
 
@@ -47,7 +47,8 @@ Enhancements / Compliance::
47
47
  * remove the 2-character (i.e., `""`) quote block syntax
48
48
  * don't allow block role to inherit from document attribute; only look for role in block attributes (#1944)
49
49
  * split out functionality of -w CLI flag (script warnings) from -v CLI flag (verbose logging) (#3030)
50
- * log possible invalid references at debug level (#3030)
50
+ * log possible invalid references at info level (#3030)
51
+ * log dropped lines at info level when attribute-missing=drop-line (#2861)
51
52
  * use the third argument of AbstractNode#attr / AbstractNode#attr? to set the name of a fallback attribute to look for on the document (#1934)
52
53
  * change default value of third argument to Abstractnode#attr / AbstractNode#attr? to nil so attribute doesn't inherit by default (#3059)
53
54
  * look for table-frame, table-grid, and table-stripes attributes on document as fallback for frame, grid, and stripes attributes on table (#3059)
@@ -64,16 +65,31 @@ Enhancements / Compliance::
64
65
  * drop verse table cell style (treat as normal table cell) (#3111)
65
66
  * allow negated subs to be specified on inline pass macro (#2191)
66
67
  * log warning if footnoteref macro is found and compat mode is not enabled (#3114)
68
+ * log info message if inline macro processor returns a String value (#3176)
69
+ * apply subs to Inline node returned by inline macro processor if subs attribute is specified (#3178)
70
+ * add create_inline_pass helper method to base extension processor class (#3178)
67
71
  * log debug message instead of warning if block style is unknown (#3092)
68
72
  * allow backend to delegate to a registered backend using the syntax synthetic:delegate when using custom templates (e.g., slides:html) (#891)
69
73
  * AbstractBlock#find_by looks inside AsciiDoc table cells if traverse_documents selector option is true (#3101)
70
74
  * AbstractBlock#find_by finds table cells, which can be selected using the :table_cell context in the selector (#2524)
71
75
  * allow ampersand to be used in e-mail address (#2553)
72
76
  * propogate ID assigned to inline passthrough (#2912)
77
+ * rename control keywords in find_by to better align with the standard NodeFilter terminology
78
+ * stop find_by iteration if filter block returns :stop directive
79
+ * rename header_footer option to standalone (while still honoring header_footer for backwards compatibility) (#1444)
80
+ * replace anchors and xrefs before footnotes (replace footnotes last in macros substitution group)
81
+ * apply substitution for custom inline macro before all other macros
82
+ * drop indexterms table from document catalog (in preparation for solution to #450 in a 2.x release)
83
+ * load additional languages for highlight.js as defined in the comma-separated highlightjs-languages attribute (#3036)
84
+ * log warning if conditional expression in ifeval directive is invalid (#3161)
85
+ * drop lines that contain an invalid preprocessor directive (#3161)
86
+ * rename AbstractBlock#find_by directives; use :prune in place of :skip_children and :reject in place of :skip
87
+ * convert example block into details/summary tag set if collapsible option is set; open by default if open option is set (#1699)
73
88
 
74
89
  Improvements::
75
90
 
76
91
  * propagate document ID to DocBook output (#3011)
92
+ * always store section numeral as string; compute roman numeral for part at assignment time (@vmj)
77
93
  * refactor code to use modern Hash syntax
78
94
  * define LIB_DIR constant; rename *_PATH constants to *_DIR constants to be consistent with RubyGems terminology (#2764)
79
95
  * only define ROOT_DIR if not already defined (for compatibility with Asciidoctor.js)
@@ -84,12 +100,15 @@ Improvements::
84
100
  * ensure linenos class is added to linenos column when source highlighter is pygments and pygments-css=style
85
101
  * rename CSS class of Pygments line numbering table to linenotable (to align with Rouge) (#1040)
86
102
  * remove unused Converter#convert_with_options method (#2891)
103
+ * add -e, --embedded CLI flag as alias for -s, --no-header-footer (require long option to specify eRuby impl) (#1444)
87
104
  * don't store the options attribute on the block once the options are parsed (#3051)
88
105
  * add an options method on AbstractNode to retrieve the set of option names (#3051)
89
106
  * pass :input_mtime option to Document constructor; let Document constructor assign docdate/time/year attributes (#3029)
90
107
  * never mutate strings; add a `frozen_string_literal: true` magic comment to top of all Ruby source files (#3054)
91
108
  * always use docdate and doctime to compute docyear and docdatetime (#3064)
92
109
  * rename PreprocessorReader#exceeded_max_depth? to PreprocessorReader#exceeds_max_depth? and return nil if includes are disabled
110
+ * log warning when include directive is not resolved due to missing attribute or blank target; always include warning in output (#2868)
111
+ * honor attribute-missing setting when processing include directives and block macros (#2855)
93
112
  * stop populating :ids table in document catalog (#3084)
94
113
  * always use :refs table in document catalog to look for registered IDs (#3084)
95
114
  * don't compute and store reference text in document catalog (#3084)
@@ -100,13 +119,17 @@ Improvements::
100
119
  * add clearer exception message when source data is binary or has invalid encoding (#2884)
101
120
  * rename context for table cell and table column to :table_cell and :table_column, respectively
102
121
  * rename hardbreaks document attribute to hardbreaks-option; retain hardbreaks as a deprecated alias (#3123)
122
+ * extend TLD for implicit e-mail addresses to 5 characters (#3154)
103
123
  * truncate with precision (instead of rounding) when computing absolute width for columns in DocBook output (#3131)
104
124
  * drop legacy LaTeX math delimiters (e.g, `$..$`) if present (#1339)
125
+ * use proper terminology in warning message about mismatched preprocessor directive (#3165)
105
126
  * upgrade MathJax to 2.7.5
106
127
 
107
128
  Bug Fixes::
108
129
 
109
130
  * fix crash caused by inline passthrough macro with the macros sub clearing the remaining passthrough placeholders (#3089)
131
+ * fix crash if ifeval directive is missing expression (#3164)
132
+ * prevent relative leveloffset from making section level negative and causing hang (#3152)
110
133
  * don't fail to parse Markdown-style quote block that only contains attribution line (#2989)
111
134
  * enforce rule that Setext section title must have at least one alphanumeric character; fixes problem w/ block nested inside quote block (#3060)
112
135
  * apply header subs to doctitle value when assigning it back to the doctitle document attribute (#3106)
@@ -125,7 +148,7 @@ Bug Fixes::
125
148
  * scope constant lookups (#2764)
126
149
  * use byteslice instead of slice to remove BOM from string (#2764)
127
150
  * don't fail if value of -a CLI option is empty string or equals sign (#2997)
128
- * allow failure level to be set to DEBUG
151
+ * allow failure level of CLI to be set to info
129
152
  * Reader#push_include should not fail if data is nil
130
153
  * fix deprecated ERB trim mode that was causing warning (#3006)
131
154
  * move time anchor after query string on vimeo video to avoid dropping options
@@ -134,6 +157,10 @@ Bug Fixes::
134
157
  * allow outfilesuffix to be soft set from API (#2640)
135
158
  * don't split paragraphs in table cell at line that resolves to blank if adjacent to other non-blank lines (#2963)
136
159
  * initialize the level to WARN when instantiating the NullLogger
160
+ * next_adjacent_block should not fail when called on dlist item (#3133)
161
+ * don't suppress browser styles for summary tag; add pointer cursor and panel margin bottom (#3155)
162
+ * only consider TLDs in e-mail address that have ASCII alpha characters
163
+ * allow underscore in domain of e-mail address
137
164
 
138
165
  Build / Infrastructure::
139
166
 
@@ -142,6 +169,7 @@ Build / Infrastructure::
142
169
  * add Ruby 2.6.0 to build matrix
143
170
  * stop running CI job on unsupported versions of Ruby
144
171
  * exclude test suite, build script, and Gemfile from gem (#3044)
172
+ * split build tasks out into individual files
145
173
 
146
174
  // tag::compact[]
147
175
  == 1.5.8 (2018-10-28) - @mojavelinux
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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.0.rc.2, 2019-03-12
3
+ v2.0.0.rc.3, 2019-03-21
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.0.rc.2
20
+ :release-version: 2.0.0.rc.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -97,12 +97,6 @@ endif::[]
97
97
 
98
98
  Wir möchten unseren großzügigen Sponsoren danken, ohne deren Unterstützung Asciidoctor nicht möglich wäre.
99
99
  Vielen Dank an die Sponsoren für ihr Engagement zur Verbesserung der technischen Dokumentation!
100
-
101
- image:https://www.okta.com/sites/all/themes/Okta/images/blog/Logos/Okta_Logo_BrightBlue_Medium.png[Okta,280,link=https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=logo&utm_campaign=sponsor,title="Add User Auth to Your Apps in Minutes with Okta"]
102
- &nbsp; &nbsp; &nbsp;
103
- image:https://secure.gravatar.com/avatar/823717a797dbd78ceff7b26aa397f383.png?size=200[OpenDevise,100,link=https://opendevise.com,title="Let the Creators of Asciidoctor and Antora Help You to Accelerate Your Docs"]
104
-
105
- Unsere Change Makers, https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=text-link&utm_campaign=sponsor[Okta] und https://opendevise.com[OpenDevise], sowie unsere Strategiesponsoren https://www.khronos.org/[Khronos Group] und Linda Roberts finanzieren Asciidoctor maßgeblich.
106
100
  Zusätzliche Mittel werden von unseren https://asciidoctor.org/supporters[Community Backers] zur Verfügung gestellt.
107
101
 
108
102
  Sie können dieses Projekt unterstützen, indem Sie Sponsor bei https://opencollective.com/asciidoctor[OpenCollective] werden.
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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.0.rc.2, 2019-03-12
3
+ v2.0.0.rc.3, 2019-03-21
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.0.rc.2
20
+ :release-version: 2.0.0.rc.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -94,12 +94,6 @@ endif::[]
94
94
 
95
95
  Nous souhaitons exprimer toute notre reconnaissance à nos généreux sponsors, sans qui Asciidoctor ne pourrait pas exister.
96
96
  Merci à vous pour votre engagement dans l'amélioration de la documentation technique !
97
-
98
- image:https://www.okta.com/sites/all/themes/Okta/images/blog/Logos/Okta_Logo_BrightBlue_Medium.png[Okta,280,link=https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=logo&utm_campaign=sponsor,title="Add User Auth to Your Apps in Minutes with Okta"]
99
- &nbsp; &nbsp; &nbsp;
100
- image:https://secure.gravatar.com/avatar/823717a797dbd78ceff7b26aa397f383.png?size=200[OpenDevise,100,link=https://opendevise.com,title="Let the Creators of Asciidoctor and Antora Help You to Accelerate Your Docs"]
101
-
102
- Asciidoctor est financé majoritairement par nos *Change Makers*, https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=text-link&utm_campaign=sponsor[Okta] et https://opendevise.com[OpenDevise], ainsi que par nos *Strategy Sponsors*, https://www.khronos.org/[Khronos Group] et Linda Roberts.
103
97
  Un apport financier supplémentaire est assuré par https://asciidoctor.org/supporters[la communauté].
104
98
 
105
99
  Vous pouvez aider ce projet en devant un sponsor sur https://opencollective.com/asciidoctor[OpenCollective].
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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.0.rc.2, 2019-03-12
3
+ v2.0.0.rc.3, 2019-03-21
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.0.rc.2
21
+ :release-version: 2.0.0.rc.3
22
22
  // URIs:
23
23
  :uri-org: https://github.com/asciidoctor
24
24
  :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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.0.rc.2, 2019-03-12
3
+ v2.0.0.rc.3, 2019-03-21
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.0.rc.2
21
+ :release-version: 2.0.0.rc.3
22
22
  // URIs:
23
23
  :uri-org: https://github.com/asciidoctor
24
24
  :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]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
- v2.0.0.rc.2, 2019-03-12
3
+ v2.0.0.rc.3, 2019-03-21
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.0.rc.2
20
+ :release-version: 2.0.0.rc.3
21
21
  // URIs:
22
22
  :uri-org: https://github.com/asciidoctor
23
23
  :uri-repo: {uri-org}/asciidoctor
@@ -101,11 +101,7 @@ endif::[]
101
101
  We want to recognize our generous sponsors, without whose support Asciidoctor would not be possible.
102
102
  Thank you sponsors for your dedication to improving the state of technical documentation!
103
103
 
104
- image:https://www.okta.com/sites/all/themes/Okta/images/blog/Logos/Okta_Logo_BrightBlue_Medium.png[Okta,280,link=https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=logo&utm_campaign=sponsor,title="Add User Auth to Your Apps in Minutes with Okta"]
105
- &nbsp; &nbsp; &nbsp;
106
- image:https://secure.gravatar.com/avatar/823717a797dbd78ceff7b26aa397f383.png?size=200[OpenDevise,100,link=https://opendevise.com,title="Let the Creators of Asciidoctor and Antora Help You to Accelerate Your Docs"]
107
-
108
- Major funding for Asciidoctor is provided by our *Change Makers*, https://developer.okta.com/signup?utm_source=asciidoctor&utm_medium=text-link&utm_campaign=sponsor[Okta] and https://opendevise.com[OpenDevise], and our *Strategy Sponsors*, https://www.khronos.org/[Khronos Group] and Linda Roberts.
104
+ Major funding for Asciidoctor is provided by our *Change Maker*, https://opendevise.com[OpenDevise], our *Strategy Sponsors*, https://www.khronos.org/[Khronos Group] and Linda Roberts, and our *Pull Request Backers*, Brian Dominick, Guillaume Grossetie, and Abel Salgado Romero.
109
105
  Additional funding is provided by our https://asciidoctor.org/supporters[Community Backers].
110
106
 
111
107
  You can support this project by becoming a sponsor on https://opencollective.com/asciidoctor[OpenCollective].
@@ -2,7 +2,7 @@
2
2
  :appendix-caption: Annexe
3
3
  :appendix-refsig: {appendix-caption}
4
4
  :caution-caption: Avertissement
5
- //:chapter-label: ???
5
+ //:chapter-label: Chapitre
6
6
  //:chapter-refsig: {chapter-label}
7
7
  :example-caption: Exemple
8
8
  :figure-caption: Figure
@@ -1,7 +1,7 @@
1
1
  /* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
2
2
  /* Uncomment @import statement when using as custom stylesheet */
3
3
  /*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
4
- article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
4
+ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}
5
5
  audio,canvas,video{display:inline-block}
6
6
  audio:not([controls]){display:none;height:0}
7
7
  script{display:none!important}
@@ -186,7 +186,8 @@ body.toc2.toc-right{padding-left:0;padding-right:20em}}
186
186
  #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
187
187
  #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
188
188
  #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
189
- .audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
189
+ details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
190
+ details>summary:first-of-type{cursor:pointer;display:list-item;outline:none;margin-bottom:.75em}
190
191
  .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
191
192
  table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
192
193
  .paragraph.lead>p,#preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
data/lib/asciidoctor.rb CHANGED
@@ -831,7 +831,7 @@ module Asciidoctor
831
831
  #
832
832
  # doc.writer@example.com
833
833
  #
834
- InlineEmailRx = %r(([\\>:/])?#{CG_WORD}(?:&amp;|[#{CC_WORD}.%+-])*@#{CG_ALNUM}[#{CC_ALNUM}.-]*\.#{CG_ALPHA}{2,4}\b)
834
+ InlineEmailRx = %r(([\\>:/])?#{CG_WORD}(?:&amp;|[#{CC_WORD}.%+-])*@#{CG_ALNUM}[#{CC_ALNUM}_.-]*\.[a-zA-Z]{2,5}\b)
835
835
 
836
836
  # Matches an inline footnote macro, which is allowed to span multiple lines.
837
837
  #
@@ -1188,7 +1188,7 @@ module Asciidoctor
1188
1188
  # foo--bar
1189
1189
  [/(#{CG_WORD})\\?--(?=#{CG_WORD})/, '&#8212;&#8203;', :leading],
1190
1190
  # ellipsis
1191
- [/\\?\.\.\./, '&#8230;&#8203;', :leading],
1191
+ [/\\?\.\.\./, '&#8230;&#8203;', :none],
1192
1192
  # right single quote
1193
1193
  [/\\?`'/, '&#8217;', :none],
1194
1194
  # apostrophe (inside a word)
@@ -1221,7 +1221,7 @@ module Asciidoctor
1221
1221
  #
1222
1222
  # Returns the Document
1223
1223
  def load input, options = {}
1224
- options = options.dup
1224
+ options = options.merge
1225
1225
 
1226
1226
  if (timings = options[:timings])
1227
1227
  timings.start :read
@@ -1233,7 +1233,9 @@ module Asciidoctor
1233
1233
 
1234
1234
  if !(attrs = options[:attributes])
1235
1235
  attrs = {}
1236
- elsif ::Hash === attrs || ((defined? ::Java::JavaUtil::Map) && ::Java::JavaUtil::Map === attrs)
1236
+ elsif ::Hash === attrs
1237
+ attrs = attrs.merge
1238
+ elsif (defined? ::Java::JavaUtil::Map) && ::Java::JavaUtil::Map === attrs
1237
1239
  attrs = attrs.dup
1238
1240
  elsif ::Array === attrs
1239
1241
  attrs = {}.tap do |accum|
@@ -1351,7 +1353,7 @@ module Asciidoctor
1351
1353
  # Returns the Document object if the converted String is written to a
1352
1354
  # file, otherwise the converted String
1353
1355
  def convert input, options = {}
1354
- options = options.dup
1356
+ options = options.merge
1355
1357
  options.delete(:parse)
1356
1358
  to_file = options.delete(:to_file)
1357
1359
  to_dir = options.delete(:to_dir)
@@ -1375,8 +1377,12 @@ module Asciidoctor
1375
1377
  write_to_target = (stream_output = to_file.respond_to? :write) ? false : (options[:to_file] = to_file)
1376
1378
  end
1377
1379
 
1378
- unless options.key? :header_footer
1379
- options[:header_footer] = true if write_to_same_dir || write_to_target
1380
+ unless options.key? :standalone
1381
+ if write_to_same_dir || write_to_target
1382
+ options[:standalone] = true
1383
+ elsif options.key? :header_footer
1384
+ options[:standalone] = options[:header_footer]
1385
+ end
1380
1386
  end
1381
1387
 
1382
1388
  # NOTE outfile may be controlled by document attributes, so resolve outfile after loading
@@ -23,10 +23,6 @@ class AbstractBlock < AbstractNode
23
23
  # Only assigned to formal block (block with title) if corresponding caption attribute is present.
24
24
  attr_accessor :numeral
25
25
 
26
- # Deprecated: Legacy property to get/set the numeral of this block.
27
- alias number numeral
28
- alias number= numeral=
29
-
30
26
  # Public: Gets/Sets the location in the AsciiDoc source where this block begins.
31
27
  attr_accessor :source_location
32
28
 
@@ -142,16 +138,19 @@ class AbstractBlock < AbstractNode
142
138
  @next_section_index > 0
143
139
  end
144
140
 
145
- # Public: Walk the document tree and find all block-level nodes that match
146
- # the specified selector (context, style, id, role, and/or custom filter).
141
+ # Deprecated: Legacy property to get the String or Integer numeral of this section.
142
+ def number
143
+ (Integer @numeral) rescue @numeral
144
+ end
145
+
146
+ # Public: Walk the document tree and find all block-level nodes that match the specified selector (context, style, id,
147
+ # role, and/or custom filter).
147
148
  #
148
- # If a Ruby block is given, it's treated as an supplemental filter. If the
149
- # filter returns true, the node is accepted and traversal continues. If the
150
- # filter returns false, the node is rejected, but traversal continues. If the
151
- # filter returns :skip, the node and all its descendants are rejected. If the
152
- # filter returns :skip_children, the node is accepted, but its descendants
153
- # are rejected. If no selector or filter block is supplied, all block-level
154
- # nodes in the tree are returned.
149
+ # If a Ruby block is given, it's applied as a supplemental filter. If the filter returns true (which implies :accept),
150
+ # the node is accepted and node traversal continues. If the filter returns false (which implies :skip), the node is
151
+ # skipped, but its children are still visited. If the filter returns :reject, the node and all its descendants are
152
+ # rejected. If the filter returns :prune, the node is accepted, but its descendants are rejected. If no selector
153
+ # or filter block is supplied, all block-level nodes in the tree are returned.
155
154
  #
156
155
  # Examples
157
156
  #
@@ -179,7 +178,13 @@ class AbstractBlock < AbstractNode
179
178
  # Move to the next adjacent block in document order. If the current block is the last
180
179
  # item in a list, this method will return the following sibling of the list block.
181
180
  def next_adjacent_block
182
- (sib = (p = parent).blocks[(p.blocks.find_index self) + 1]) ? sib : p.next_adjacent_block unless @context == :document
181
+ unless @context == :document
182
+ if (p = @parent).context == :dlist && @context == :list_item
183
+ (sib = p.items[(p.items.find_index {|terms, desc| (terms.include? self) || desc == self }) + 1]) ? sib : p.next_adjacent_block
184
+ else
185
+ (sib = p.blocks[(p.blocks.find_index self) + 1]) ? sib : p.next_adjacent_block
186
+ end
187
+ end
183
188
  end
184
189
 
185
190
  # Public: Get the Array of child Section objects
@@ -397,16 +402,12 @@ class AbstractBlock < AbstractNode
397
402
  if (like = section.numbered)
398
403
  if (sectname = section.sectname) == 'appendix'
399
404
  section.numeral = @document.counter 'appendix-number', 'A'
400
- if (caption = @document.attributes['appendix-caption'])
401
- section.caption = %(#{caption} #{section.numeral}: )
402
- else
403
- section.caption = %(#{section.numeral}. )
404
- end
405
+ section.caption = (caption = @document.attributes['appendix-caption']) ? %(#{caption} #{section.numeral}: ) : %(#{section.numeral}. )
405
406
  # NOTE currently chapters in a book doctype are sequential even for multi-part books (see #979)
406
407
  elsif sectname == 'chapter' || like == :chapter
407
- section.numeral = @document.counter 'chapter-number', 1
408
+ section.numeral = (@document.counter 'chapter-number', 1).to_s
408
409
  else
409
- section.numeral = @next_section_ordinal
410
+ section.numeral = sectname == 'part' ? (Helpers.int_to_roman @next_section_ordinal) : @next_section_ordinal.to_s
410
411
  @next_section_ordinal += 1
411
412
  end
412
413
  end
@@ -440,23 +441,28 @@ class AbstractBlock < AbstractNode
440
441
  (!(style_selector = selector[:style]) || style_selector == @style) &&
441
442
  (!(role_selector = selector[:role]) || (has_role? role_selector)) &&
442
443
  (!(id_selector = selector[:id]) || id_selector == @id)
443
- if id_selector
444
- block_given? && !(yield self) ? result.clear : (result.replace [self])
445
- raise ::StopIteration
446
- elsif block_given?
444
+ if block_given?
447
445
  if (verdict = yield self)
448
446
  case verdict
449
- when :skip_children
447
+ when :prune
450
448
  result << self
449
+ raise ::StopIteration if id_selector
451
450
  return result
452
- when :skip
451
+ when :reject
452
+ raise ::StopIteration if id_selector
453
453
  return result
454
+ when :stop
455
+ raise ::StopIteration
454
456
  else
455
457
  result << self
458
+ raise ::StopIteration if id_selector
456
459
  end
460
+ elsif id_selector
461
+ raise ::StopIteration
457
462
  end
458
463
  else
459
464
  result << self
465
+ raise ::StopIteration if id_selector
460
466
  end
461
467
  end
462
468
  case @context
@@ -25,19 +25,15 @@ class AbstractNode
25
25
  attr_reader :parent
26
26
 
27
27
  def initialize parent, context, opts = {}
28
+ # document is a special case, should refer to itself
28
29
  if context == :document
29
- # document is a special case, should refer to itself
30
- @document, @parent = self, nil
31
- else
32
- if parent
33
- @document, @parent = parent.document, parent
34
- else
35
- @document = @parent = nil
36
- end
30
+ @document = self
31
+ elsif parent
32
+ @document = (@parent = parent).document
37
33
  end
38
34
  @node_name = (@context = context).to_s
39
- # QUESTION are we correct in duplicating the attributes (seems to be just as fast)
40
- @attributes = (opts.key? :attributes) ? opts[:attributes].dup : {}
35
+ # NOTE the value of the :attributes option may be nil on an Inline node
36
+ @attributes = (attrs = opts[:attributes]) ? attrs.merge : {}
41
37
  @passthroughs = []
42
38
  end
43
39