commit rubygem-asciidoctor for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-asciidoctor for openSUSE:Factory checked in at 2024-06-24 20:50:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-asciidoctor (Old) and /work/SRC/openSUSE:Factory/.rubygem-asciidoctor.new.18349 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-asciidoctor" Mon Jun 24 20:50:57 2024 rev:12 rq:1182762 version:2.0.23 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-asciidoctor/rubygem-asciidoctor.changes 2023-06-27 23:15:41.175045431 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-asciidoctor.new.18349/rubygem-asciidoctor.changes 2024-06-24 20:51:55.061291974 +0200 @@ -1,0 +2,152 @@ +Fri Jun 21 09:18:33 UTC 2024 - Dan Čermák <dan.cermak@posteo.net> + +- 2.0.23: + +This is a patch release in the 2.0.x release line to fix bugs and deal with compliance issues. + +The primary bug fix in this release is to not duplicate the block attribute line above a detached block that breaks a dlist, which fixes the duplicate role warning on that detached block. +The main compliance improvement is to encode spaces in mailto links using %20, in accordance with RFC 3986, instead of +. + +This release introduces several fixes and improvements related to parsing a table that has jagged rows. +If the colspan of the last cell in a row, including the last row, exceeds the specified number of columns, only that row is dropped. +On the other hand, if the last row is missing cells, an error message is logged to notify the author. + +If a URL is used as the target of an xref shorthand, the processor now treats the URL as a fragment identifier instead of crashing. + +Finally, repeating spaces in verbatim content in the manpage output are preserved. + +## Distribution + +- [RubyGem (asciidoctor)](https://rubygems.org/gems/asciidoctor) + +Asciidoctor is also packaged for [Fedora](https://apps.fedoraproject.org/packages/rubygem-asciidoctor), [Debian](https://packages.debian.org/sid/asciidoctor), [Ubuntu](https://packages.ubuntu.com/search?keywords=asciidoctor), [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=asciidoctor), [OpenSUSE](https://software.opensuse.org/package/rubygem-asciidoctor), and [Homebrew](https://formulae.brew.sh/formula/asciidoctor). You can use the system's package manager to install the package named **asciidoctor**. + +## Changelog + +### Compliance + +* Encode spaces in mailto links as %20, in accordance with RFC 3986, instead of + (#4576) + +### Improvements + +* Log error when an incomplete row is detected at the end of a table (#4573) + +### Bug Fixes + +* Don't leave behind empty line inside skipped preprocessor conditional (#4580) +* Don't duplicate block attribute line above detached block that breaks a dlist; fixes duplicate role on detached block (#4565) +* Don't crash when parsing xref shorthand if target starts with URL protocol and text is offset by space (#4570) +* Only drop current row if colspan of last cell exceeds specified number of columns (#4587) +* Drop last row if colspan of last cell in table exceeds specified number of columns (#4587) +* Preserve repeating spaces in verbatim content in manpage output (#3583) + +## Release meta + +Released on: 2024-05-17 +Released by: @mojavelinux +Release beer: Marmot Passage by Two 22 Brew + +Logs: [resolved issues](https://github.com/asciidoctor/asciidoctor/issues?q=is%3Aissue+label%3Av2.0....) | [source diff](https://github.com/asciidoctor/asciidoctor/compare/v2.0.22...v2.0.23) | [gem diff](https://my.diffend.io/gems/asciidoctor/v2.0.22/v2.0.23) + +## Credits + +A very special thanks to all the **awesome** [supporters of the Asciidoctor OpenCollective campaign](https://opencollective.com/asciidoctor), who provide critical funding for the ongoing development of this project. + +2.0.22: + +This is a patch release in the 2.0.x release line to further compatibility with Ruby 3.3. + +The most critical fix in this release is to remove use of the base64 library since it will no longer being provided as part of the Ruby language starting with Ruby 3.4. When using Ruby 3.3, users would see a warning if this library is used, which happens when the data-uri attribute is set. The functionality has been replaced with a lower-level method on the String object (String#pack), which the base64 library delegates to anyway. + +This release also sets the cloaked-context attribute on a source block that is defined using either a styled paragraph or a literal or fenced code structural container. This matches the functionality used for custom block extensions (when the source context does not match the final parsed context). + +## Distribution + +- [RubyGem (asciidoctor)](https://rubygems.org/gems/asciidoctor) + +Asciidoctor is also packaged for [Fedora](https://apps.fedoraproject.org/packages/rubygem-asciidoctor), [Debian](https://packages.debian.org/sid/asciidoctor), [Ubuntu](https://packages.ubuntu.com/search?keywords=asciidoctor), [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=asciidoctor), [OpenSUSE](https://software.opensuse.org/package/rubygem-asciidoctor), and [Homebrew](https://formulae.brew.sh/formula/asciidoctor). You can use the system's package manager to install the package named **asciidoctor**. + +## Changelog + +### Improvements + +* Set `cloaked-context` attribute on source block when context is not `:listing` (#4556) + +### Compliance + +* Remove use of base64 library to prevent warning in Ruby >= 3.3 (#4561) + +## Release meta + +Released on: 2024-03-08 +Released by: @mojavelinux +Release beer: Turbo Laser by Resolute Brewing Company + +Logs: [resolved issues](https://github.com/asciidoctor/asciidoctor/issues?q=is%3Aissue+label%3Av2.0....) | [source diff](https://github.com/asciidoctor/asciidoctor/compare/v2.0.21...v2.0.22) | [gem diff](https://my.diffend.io/gems/asciidoctor/v2.0.21/v2.0.22) + +## Credits + +A very special thanks to all the **awesome** [supporters of the Asciidoctor OpenCollective campaign](https://opencollective.com/asciidoctor), who provide critical funding for the ongoing development of this project. + +2.0.21: + +This is a patch release in the 2.0.x release line, primarily to address compatibility with Ruby 3.3. While development of Asciidoctor 2.1 is beginning to pick up again, we extracted several other important improvements and bug fixes from main to include in this patch release. + +The most critical fix in this release is to make Asciidoctor's logger compatible with the logger API in Ruby 3.3. The code is now tested against Ruby 3.3 on each change. Nearly as important, this release also turns off Ruby's system-dependent newline conversion when writing files so that Asciidoctor's output is consistent between *nix and Windows. + +Numerous changes were made to correct AsciiDoc parsing. A nested dlist attached using a list continuation no longer consumes a detached paragraph. And an attached block is correctly attached to a nested dlist when that dlist is offset from its parent by an empty line. The secondary and tertiary terms on the `indexterm` macro are preserved when the primary term is quoted and contains an equals sign. And a bare URL enclosed in angle brackets acts as unconstrained syntax that stops at the first occurrence of a closing angle bracket. When includes are not enabled, any spaces in the include target are preserved when generating the fallback link. + +Several changes were made to the DocBook output to address compliance. The abstract is moved inside the `<info>` tag (applies to both the abstract in the preamble as well an an abstract for a book part). The `scaledwidth` and `scale` attributes are now supported on an inline macro, like with a block image macro. + +A few changes to the manpage output were made. Cells in the head row are styled as bold. Paragraph breaks in a normal table cell are preserved. + +Finally, a few refinements to the default stylesheet were applied. The extra border below the doctitle when the sidebar toc is collapsed into main content area was removed. And a text decoration was added to the active footnote number link in the footnotes list. + +## Distribution + +- [RubyGem (asciidoctor)](https://rubygems.org/gems/asciidoctor) + +Asciidoctor is also packaged for [Fedora](https://apps.fedoraproject.org/packages/rubygem-asciidoctor), [Debian](https://packages.debian.org/sid/asciidoctor), [Ubuntu](https://packages.ubuntu.com/search?keywords=asciidoctor), [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=asciidoctor), [OpenSUSE](https://software.opensuse.org/package/rubygem-asciidoctor), and [Homebrew](https://formulae.brew.sh/formula/asciidoctor). You can use the system's package manager to install the package named **asciidoctor**. + +## Changelog + +### Compliance + +* Turn off system-dependent newline conversion when writing files; don't convert line feeds to system-dependent newline (#4550) +* Support logger in Ruby 3.3 by instantiating super class (#4493) (*@mtasaka*) +* Add support for `scaledwidth` and `scale` attributes on inline image macro in DocBook output (#4552) +* Update latest Ruby to 3.3 in CI workflows + +### Improvements + +* Change title to doctitle in warning message about use of abstract to make subject more clear +* Modify default stylesheet to add text decoration to active footnote number link in footnotes list (#4530) (@Larhzu) + +### Bug Fixes + +* Nested dlist attached using list continuation should not consume detached paragraph (#3535) +* Don't break nested dlist with attached block if offset from parent list by empty line (#3693) +* Preserve paragraph breaks in normal table cell in manpage output (#4481) +* Style cells in head row as bold in manpage output (#4490) +* Escape spaces in include target (using inline passthrough) when generating link from include directive (#4461) +* Move abstract inside info tag in DocBook output (#3602) +* Honor secondary and tertiary terms on `indexterm` macro when primary term is quoted and contains an equals sign (#3652) +* Remove extra border below doctitle when sidebar toc is collapsed into main content area (#4523) +* Treat bare URL enclosed in angle brackets as unconstrained syntax; only match until closing angled bracket (#4468) +* Allow URL enclosed in angled brackets syntax to be escaped using backslash (#4468) + +## Release meta + +Released on: 2024-02-20 +Released by: @mojavelinux +Release beer: Lunch by Maine Beer Company + +Logs: [resolved issues](https://github.com/asciidoctor/asciidoctor/issues?q=is%3Aissue+label%3Av2.0....) | [source diff](https://github.com/asciidoctor/asciidoctor/compare/v2.0.20...v2.0.21) | [gem diff](https://my.diffend.io/gems/asciidoctor/v2.0.20/v2.0.21) + +## Credits + +A very special thanks to all the **awesome** [supporters of the Asciidoctor OpenCollective campaign](https://opencollective.com/asciidoctor), who provide critical funding for the ongoing development of this project. + + + +------------------------------------------------------------------- Old: ---- asciidoctor-2.0.20.gem New: ---- asciidoctor-2.0.23.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-asciidoctor.spec ++++++ --- /var/tmp/diff_new_pack.8mzTM8/_old 2024-06-24 20:51:55.729316392 +0200 +++ /var/tmp/diff_new_pack.8mzTM8/_new 2024-06-24 20:51:55.729316392 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-asciidoctor # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,11 +24,10 @@ # Name: rubygem-asciidoctor -Version: 2.0.20 +Version: 2.0.23 Release: 0 %define mod_name asciidoctor %define mod_full_name %{mod_name}-%{version} -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{rubygem gem2rpm} BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 @@ -38,7 +37,6 @@ Source1: gem2rpm.yml Summary: An implementation of the AsciiDoc text processor and publishing License: MIT -Group: Development/Languages/Ruby PreReq: update-alternatives %description ++++++ asciidoctor-2.0.20.gem -> asciidoctor-2.0.23.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.adoc new/CHANGELOG.adoc --- old/CHANGELOG.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/CHANGELOG.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -16,6 +16,75 @@ This project utilizes semantic versioning. // tag::compact[] +== 2.0.23 (2024-05-17) - @mojavelinux + +Compliance:: + + * Encode spaces in mailto links as %20, in accordance with RFC 3986, instead of + (#4576) + +Improvements:: + + * Log error when an incomplete row is detected at the end of a table (#4573) + +Bug Fixes:: + + * Don't leave behind empty line inside skipped preprocessor conditional (#4580) + * Don't duplicate block attribute line above detached block that breaks a dlist; fixes duplicate role on detached block (#4565) + * Don't crash when parsing xref shorthand if target starts with URL protocol and text is offset by space (#4570) + * Only drop current row if colspan of last cell exceeds specified number of columns (#4587) + * Drop last row if colspan of last cell in table exceeds specified number of columns (#4587) + * Preserve repeating spaces in verbatim content in manpage output (#3583) + +=== Details + +{url-repo}/releases/tag/v2.0.23[git tag] | {url-repo}/compare/v2.0.22\...v2.0.23[full diff] +// end::compact[] + +== 2.0.22 (2024-03-08) - @mojavelinux + +Improvements:: + + * Set `cloaked-context` attribute on source block when context is not `:listing` (#4556) + +Compliance:: + + * Remove use of base64 library to prevent warning in Ruby >= 3.3 (#4561) + +=== Details + +{url-repo}/releases/tag/v2.0.22[git tag] | {url-repo}/compare/v2.0.21\...v2.0.22[full diff] + +== 2.0.21 (2024-02-20) - @mojavelinux + +Compliance:: + + * Turn off system-dependent newline conversion when writing files; don't convert line feeds to system-dependent newline (#4550) + * Support logger in Ruby 3.3 by instantiating super class (#4493) (*@mtasaka*) + * Add support for `scaledwidth` and `scale` attributes on inline image macro in DocBook output (#4552) + * Update latest Ruby to 3.3 in CI workflows + +Improvements:: + + * Change title to doctitle in warning message about use of abstract to make subject more clear + * Modify default stylesheet to add text decoration to active footnote number link in footnotes list (#4530) (@Larhzu) + +Bug Fixes:: + + * Nested dlist attached using list continuation should not consume detached paragraph (#3535) + * Don't break nested dlist with attached block if offset from parent list by empty line (#3693) + * Preserve paragraph breaks in normal table cell in manpage output (#4481) + * Style cells in head row as bold in manpage output (#4490) + * Escape spaces in include target (using inline passthrough) when generating link from include directive (#4461) + * Move abstract inside info tag in DocBook output (#3602) + * Honor secondary and tertiary terms on `indexterm` macro when primary term is quoted and contains an equals sign (#3652) + * Remove extra border below doctitle when sidebar toc is collapsed into main content area (#4523) + * Treat bare URL enclosed in angle brackets as unconstrained syntax; only match until closing angled bracket (#4468) + * Allow URL enclosed in angled brackets syntax to be escaped using backslash (#4468) + +=== Details + +{url-repo}/releases/tag/v2.0.21[git tag] | {url-repo}/compare/v2.0.20\...v2.0.21[full diff] + == 2.0.20 (2023-05-18) - @mojavelinux Bug Fixes:: @@ -26,7 +95,6 @@ === Details {url-repo}/releases/tag/v2.0.20[git tag] | {url-repo}/compare/v2.0.19\...v2.0.20[full diff] -// end::compact[] == 2.0.19 (2023-05-17) - @mojavelinux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README-de.adoc new/README-de.adoc --- old/README-de.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/README-de.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ = Asciidoctor Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]> -v2.0.20, 2023-05-18 +v2.0.23, 2024-05-17 // settings: :idprefix: :idseparator: - @@ -16,7 +16,7 @@ :warning-caption: :warning: endif::[] // Variables: -:release-version: 2.0.20 +:release-version: 2.0.23 // URIs: :uri-org: https://github.com/asciidoctor :uri-repo: {uri-org}/asciidoctor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README-fr.adoc new/README-fr.adoc --- old/README-fr.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/README-fr.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ = Asciidoctor Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]> -v2.0.20, 2023-05-18 +v2.0.23, 2024-05-17 // settings: :idprefix: :idseparator: - @@ -16,7 +16,7 @@ :warning-caption: :warning: endif::[] // Variables: -:release-version: 2.0.20 +:release-version: 2.0.23 // URIs: :uri-org: https://github.com/asciidoctor :uri-repo: {uri-org}/asciidoctor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README-jp.adoc new/README-jp.adoc --- old/README-jp.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/README-jp.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ = Asciidoctor Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]> -v2.0.20, 2023-05-18 +v2.0.23, 2024-05-17 // settings: :idprefix: :idseparator: - @@ -16,7 +16,7 @@ :warning-caption: :warning: endif::[] // Variables: -:release-version: 2.0.20 +:release-version: 2.0.23 // URIs: :uri-org: https://github.com/asciidoctor :uri-repo: {uri-org}/asciidoctor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README-zh_CN.adoc new/README-zh_CN.adoc --- old/README-zh_CN.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/README-zh_CN.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ = Asciidoctor Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]> -v2.0.20, 2023-05-18 +v2.0.23, 2024-05-17 // settings: :page-layout: base :idprefix: @@ -17,7 +17,7 @@ :warning-caption: :warning: endif::[] // Variables: -:release-version: 2.0.20 +:release-version: 2.0.23 // URIs: :uri-org: https://github.com/asciidoctor :uri-repo: {uri-org}/asciidoctor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.adoc new/README.adoc --- old/README.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/README.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ = Asciidoctor Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]> -v2.0.20, 2023-05-18 +v2.0.23, 2024-05-17 // settings: :idprefix: :idseparator: - @@ -16,7 +16,7 @@ :warning-caption: :warning: endif::[] // Variables: -:release-version: 2.0.20 +:release-version: 2.0.23 // URLs: :url-org: https://github.com/asciidoctor :url-repo: {url-org}/asciidoctor @@ -130,7 +130,7 @@ Asciidoctor works on Linux, macOS and Windows and requires one of the following implementations of {url-ruby}[Ruby]: -* CRuby (aka MRI) 2.3 - 3.2 +* CRuby (aka MRI) 2.3 - 3.3 * JRuby 9.1 - 9.4 * TruffleRuby (GraalVM) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asciidoctor.gemspec new/asciidoctor.gemspec --- old/asciidoctor.gemspec 2018-03-20 01:00:00.000000000 +0100 +++ new/asciidoctor.gemspec 2018-03-20 01:00:00.000000000 +0100 @@ -39,7 +39,7 @@ # erubi is needed for testing alternate eRuby impls s.add_development_dependency 'erubi', '~> 1.10.0' s.add_development_dependency 'haml', '~> 6.1.0' - s.add_development_dependency 'minitest', '~> 5.14.0' + s.add_development_dependency 'minitest', '~> 5.22.0' s.add_development_dependency 'nokogiri', '~> 1.13.0' s.add_development_dependency 'rake', '~> 12.3.0' s.add_development_dependency 'slim', '~> 4.1.0' Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/data/reference/syntax.adoc new/data/reference/syntax.adoc --- old/data/reference/syntax.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/data/reference/syntax.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -112,7 +112,7 @@ .Some Authors [circle] -- Edgar Allen Poe +- Edgar Allan Poe - Sheri S. Tepper - Bill Bryson diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/data/stylesheets/asciidoctor-default.css new/data/stylesheets/asciidoctor-default.css --- old/data/stylesheets/asciidoctor-default.css 2018-03-20 01:00:00.000000000 +0100 +++ new/data/stylesheets/asciidoctor-default.css 2018-03-20 01:00:00.000000000 +0100 @@ -130,7 +130,7 @@ #content::before{content:none} #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0} #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf} -#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} +#header>h1:only-child{border-bottom:1px solid #dddddf;padding-bottom:8px} #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap} #header .details span:first-child{margin-left:-.125em} #header .details span.email a{color:rgba(0,0,0,.85)} @@ -152,6 +152,7 @@ #toctitle{color:#7a2518;font-size:1.2em} @media screen and (min-width:768px){#toctitle{font-size:1.375em} body.toc2{padding-left:15em;padding-right:0} +body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto} #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em} #toc.toc2>ul{font-size:.9em;margin-bottom:0} @@ -317,7 +318,7 @@ a.image object{pointer-events:none} sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} sup.footnote a,sup.footnoteref a{text-decoration:none} -sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline} +sup.footnote a:active,sup.footnoteref a:active,#footnotes .footnote a:first-of-type:active{text-decoration:underline} #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em} #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0} #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/abstract_node.rb new/lib/asciidoctor/abstract_node.rb --- old/lib/asciidoctor/abstract_node.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/abstract_node.rb 2018-03-20 01:00:00.000000000 +0100 @@ -354,8 +354,8 @@ # # First, and foremost, the target image path is cleaned if the document safe mode level # is set to at least SafeMode::SAFE (a condition which is true by default) to prevent access - # to ancestor paths in the filesystem. The image data is then read and converted to - # Base64. Finally, a data URI is built which can be used in an image tag. + # to ancestor paths in the filesystem. The image data is then read and converted to base64. + # Finally, a data URI is built which can be used in an image tag. # # target_image - A String path to the target image # asset_dir_key - The String attribute key used to lookup the directory where @@ -376,8 +376,8 @@ end if ::File.readable? image_path - # NOTE base64 is autoloaded by reference to ::Base64 - %(data:#{mimetype};base64,#{::Base64.strict_encode64 ::File.binread image_path}) + # NOTE pack 'm0' is equivalent to Base64.strict_encode64 + %(data:#{mimetype};base64,#{[(::File.binread image_path)].pack 'm0'}) else logger.warn %(image to embed not found or not readable: #{image_path}) %(data:#{mimetype};base64,) @@ -410,8 +410,8 @@ begin mimetype, bindata = ::OpenURI.open_uri(image_uri, URI_READ_MODE) {|f| [f.content_type, f.read] } - # NOTE base64 is autoloaded by reference to ::Base64 - %(data:#{mimetype};base64,#{::Base64.strict_encode64 bindata}) + # NOTE pack 'm0' is equivalent to Base64.strict_encode64 + %(data:#{mimetype};base64,#{[bindata].pack 'm0'}) rescue logger.warn %(could not retrieve image data from URI: #{image_uri}) image_uri diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/converter/docbook5.rb new/lib/asciidoctor/converter/docbook5.rb --- old/lib/asciidoctor/converter/docbook5.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/converter/docbook5.rb 2018-03-20 01:00:00.000000000 +0100 @@ -44,7 +44,8 @@ end root_tag_idx = result.size id = node.id - result << (document_info_tag node) unless node.noheader + abstract = find_root_abstract node + result << (document_info_tag node, abstract) unless node.noheader if manpage result << '<refentry>' result << '<refmeta>' @@ -61,7 +62,9 @@ unless (docinfo_content = node.docinfo :header).empty? result << docinfo_content end - result << node.content if node.blocks? + abstract = extract_abstract node, abstract if abstract + result << (node.blocks.map {|block| block.convert }.compact.join LF) if node.blocks? + restore_abstract abstract if abstract unless (docinfo_content = node.docinfo :footer).empty? result << docinfo_content end @@ -73,7 +76,15 @@ result.join LF end - alias convert_embedded content_only + def convert_embedded node + # NOTE in DocBook 5, the root abstract must be in the info tag and is thus not part of the body + if @backend == 'docbook5' && (abstract = find_root_abstract node) + abstract = extract_abstract node, abstract + end + result = node.blocks.map {|block| block.convert }.compact.join LF + restore_abstract abstract if abstract + result + end def convert_section node if node.document.doctype == 'manpage' @@ -183,27 +194,11 @@ end def convert_image node - # NOTE according to the DocBook spec, content area, scaling, and scaling to fit are mutually exclusive - # See http://tdg.docbook.org/tdg/4.5/imagedata-x.html#d0e79635 - if node.attr? 'scaledwidth' - width_attribute = %( width="#{node.attr 'scaledwidth'}") - depth_attribute = '' - scale_attribute = '' - elsif node.attr? 'scale' - # QUESTION should we set the viewport using width and depth? (the scaled image would be contained within this box) - #width_attribute = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : '' - #depth_attribute = (node.attr? 'height') ? %( depth="#{node.attr 'height'}") : '' - scale_attribute = %( scale="#{node.attr 'scale'}") - else - width_attribute = (node.attr? 'width') ? %( contentwidth="#{node.attr 'width'}") : '' - depth_attribute = (node.attr? 'height') ? %( contentdepth="#{node.attr 'height'}") : '' - scale_attribute = '' - end align_attribute = (node.attr? 'align') ? %( align="#{node.attr 'align'}") : '' mediaobject = %(<mediaobject> <imageobject> -<imagedata fileref="#{node.image_uri(node.attr 'target')}"#{width_attribute}#{depth_attribute}#{scale_attribute}#{align_attribute}/> +<imagedata fileref="#{node.image_uri node.attr 'target'}"#{image_size_attributes node.attributes}#{align_attribute}/> </imageobject> <textobject><phrase>#{node.alt}</phrase></textobject> </mediaobject>) @@ -308,13 +303,17 @@ def convert_open node case node.style when 'abstract' - if node.parent == node.document && node.document.doctype == 'book' - logger.warn 'abstract block cannot be used in a document without a title when doctype is book. Excluding block content.' + if (parent = node.parent) == node.document && node.document.doctype == 'book' + logger.warn 'abstract block cannot be used in a document without a doctitle when doctype is book. Excluding block content.' '' else - %(<abstract> + result = %(<abstract> #{title_tag node}#{enclose_content node} </abstract>) + if @backend == 'docbook5' && !(node.option? 'root') && (parent.context == :open ? parent.style == 'partintro' : parent.context == :section && parent.sectname == 'partintro') && node == parent.blocks[0] + result = %(<info>\n#{result}\n</info>) + end + result end when 'partintro' if node.level == 0 && node.parent.context == :section && node.document.doctype == 'book' @@ -536,11 +535,9 @@ end def convert_inline_image node - width_attribute = (node.attr? 'width') ? %( contentwidth="#{node.attr 'width'}") : '' - depth_attribute = (node.attr? 'height') ? %( contentdepth="#{node.attr 'height'}") : '' %(<inlinemediaobject#{common_attributes nil, node.role}> <imageobject> -<imagedata fileref="#{node.type == 'icon' ? (node.icon_uri node.target) : (node.image_uri node.target)}"#{width_attribute}#{depth_attribute}/> +<imagedata fileref="#{node.type == 'icon' ? (node.icon_uri node.target) : (node.image_uri node.target)}"#{image_size_attributes node.attributes}/> </imageobject> <textobject><phrase>#{node.alt}</phrase></textobject> </inlinemediaobject>) @@ -648,6 +645,23 @@ end end + def image_size_attributes attributes + # NOTE according to the DocBook spec, content area, scaling, and scaling to fit are mutually exclusive + # See http://tdg.docbook.org/tdg/4.5/imagedata-x.html#d0e79635 + if attributes.key? 'scaledwidth' + %( width="#{attributes['scaledwidth']}") + elsif attributes.key? 'scale' + # QUESTION should we set the viewport using width and depth? (the scaled image would be contained within this box) + #width_attribute = (attributes.key? 'width') ? %( width="#{attributes['width']}") : '' + #depth_attribute = (attributes.key? 'height') ? %( depth="#{attributes['height']}") : '' + %( scale="#{attributes['scale']}") + else + width_attribute = (attributes.key? 'width') ? %( contentwidth="#{attributes['width']}") : '' + depth_attribute = (attributes.key? 'height') ? %( contentdepth="#{attributes['height']}") : '' + %(#{width_attribute}#{depth_attribute}) + end + end + def author_tag doc, author result = [] result << '<author>' @@ -661,7 +675,7 @@ result.join LF end - def document_info_tag doc + def document_info_tag doc, abstract result = ['<info>'] unless doc.notitle if (title = doc.doctitle partition: true, use_fallback: true).subtitle? @@ -715,11 +729,37 @@ result << docinfo_content end end + if abstract + abstract.set_option 'root' + result << (convert abstract, abstract.node_name) + abstract.remove_attr 'root-option' + end result << '</info>' result.join LF end + def find_root_abstract doc + return unless doc.blocks? + if (first_block = doc.blocks[0]).context == :preamble + return unless (first_block = first_block.blocks[0]) + elsif first_block.context == :section + return first_block if first_block.sectname == 'abstract' + return unless first_block.sectname == 'preface' && (first_block = first_block.blocks[0]) + end + return first_block if first_block.style == 'abstract' && first_block.context == :open + end + + def extract_abstract document, abstract + parent = abstract.parent + parent = parent.parent while parent != document && parent.blocks.length == 1 + parent.blocks.delete_at 0 + end + + def restore_abstract abstract + abstract.parent.blocks.insert 0, abstract + end + def get_root_document node while (node = node.document).nested? node = node.parent_document @@ -742,26 +782,18 @@ def cover_tag doc, face, use_placeholder = false if (cover_image = doc.attr %(#{face}-cover-image)) - width_attr = '' - depth_attr = '' if (cover_image.include? ':') && ImageMacroRx =~ cover_image - attrlist = $2 - cover_image = doc.image_uri $1 - if attrlist - attrs = (AttributeList.new attrlist).parse ['alt', 'width', 'height'] - if attrs.key? 'scaledwidth' - # NOTE scalefit="1" is the default in this case - width_attr = %( width="#{attrs['scaledwidth']}") - else - width_attr = %( contentwidth="#{attrs['width']}") if attrs.key? 'width' - depth_attr = %( contentdepth="#{attrs['height']}") if attrs.key? 'height' - end - end + target, attrlist = $1, $2 + cover_image = doc.image_uri target + # NOTE scalefit="1" is the default for a cover image + size_attrs = image_size_attributes (AttributeList.new attrlist).parse %w(alt width height) if attrlist + else + size_attrs = '' end %(<cover role="#{face}"> <mediaobject> <imageobject> -<imagedata fileref="#{cover_image}"#{width_attr}#{depth_attr}/> +<imagedata fileref="#{cover_image}"#{size_attrs}/> </imageobject> </mediaobject> </cover>) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/converter/html5.rb new/lib/asciidoctor/converter/html5.rb --- old/lib/asciidoctor/converter/html5.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/converter/html5.rb 2018-03-20 01:00:00.000000000 +0100 @@ -748,7 +748,7 @@ def convert_open node if (style = node.style) == 'abstract' if node.parent == node.document && node.document.doctype == 'book' - logger.warn 'abstract block cannot be used in a document without a title when doctype is book. Excluding block content.' + logger.warn 'abstract block cannot be used in a document without a doctitle when doctype is book. Excluding block content.' '' else id_attr = node.id ? %( id="#{node.id}") : '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/converter/manpage.rb new/lib/asciidoctor/converter/manpage.rb --- old/lib/asciidoctor/converter/manpage.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/converter/manpage.rb 2018-03-20 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ # frozen_string_literal: true module Asciidoctor -# A built-in {Converter} implementation that generates the man page (troff) format. +# A built-in {Converter} implementation that generates the man page (groff) format. # # The output of this converter adheres to the man definition as defined by # groff and uses the manpage output of the DocBook toolchain as a foundation. @@ -432,7 +432,7 @@ when :literal cell_content = %(.nf#{LF}#{manify cell.text, whitespace: :preserve}#{LF}.fi) else - cell_content = manify cell.content.join, whitespace: :normalize + cell_content = cell.content.map {|p| manify p, whitespace: :normalize }.join %(#{LF}.sp#{LF}) end row_text[row_index] << %(#{cell_content}#{LF}) else # tsec == :head || tsec == :foot @@ -476,21 +476,14 @@ end unless rows.empty? end - #row_header.each do |row| - # result << LF - # row.each_with_index do |cell, i| - # result << (cell.join ' ') - # result << ' ' if row.size > i + 1 - # end - #end - # FIXME temporary fix to get basic table to display - result << LF - result << ('lt ' * row_header[0].size).chop - - result << %(.#{LF}) - row_text.each do |row| - result << row.join + if node.has_header_option && (header_row_text = row_text[0]) + result << %(#{LF}#{row_header[0].join ' '}.) + result << %(#{LF}#{header_row_text.join}) + result << '.T&' + row_text = row_text.slice 1, row_text.length end + result << %(#{LF}#{row_header[0].map { 'lt' }.join ' '}.#{LF}) + row_text.each {|row| result << row.join } result << %(.TE#{LF}.sp) result.join end @@ -706,46 +699,44 @@ def manify str, opts = {} case opts.fetch :whitespace, :collapse when :preserve - str = str.gsub TAB, ET + str = (str.gsub TAB, ET).gsub(/(^)? +/) { $1 ? $& : %(#{ESC_BS}{$&}) } when :normalize str = str.gsub WrappedIndentRx, LF else str = str.tr_s WHITESPACE, ' ' end - str = str - .gsub(LiteralBackslashRx) { $1 ? $& : '\\(rs' } # literal backslash (not a troff escape sequence) - .gsub(EllipsisCharRefRx, '...') # horizontal ellipsis - .gsub(LeadingPeriodRx, '\\\&.') # leading . is used in troff for macro call or other formatting; replace with \&. - .gsub(EscapedMacroRx) do # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line - (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest}) - end - .gsub('-', '\-') - .gsub('<', '<') - .gsub('>', '>') - .gsub('+', '+') # plus sign; alternately could use \c(pl - .gsub(' ', '\~') # non-breaking space - .gsub('©', '\(co') # copyright sign - .gsub('®', '\(rg') # registered sign - .gsub('™', '\(tm') # trademark sign - .gsub('°', '\(de') # degree sign - .gsub(' ', ' ') # thin space - .gsub('–', '\(en') # en dash - .gsub(EmDashCharRefRx, '\(em') # em dash - .gsub('‘', '\(oq') # left single quotation mark - .gsub('’', '\(cq') # right single quotation mark - .gsub('“', '\(lq') # left double quotation mark - .gsub('”', '\(rq') # right double quotation mark - .gsub('←', '\(<-') # leftwards arrow - .gsub('→', '\(->') # rightwards arrow - .gsub('⇐', '\(lA') # leftwards double arrow - .gsub('⇒', '\(rA') # rightwards double arrow - .gsub('', '\:') # zero width space - .gsub('&', '&') # literal ampersand (NOTE must take place after any other replacement that includes &) - .gsub('\'', '\*(Aq') # apostrophe / neutral single quote - .gsub(MockMacroRx, '\1') # mock boundary - .gsub(ESC_BS, '\\') # unescape troff backslash (NOTE update if more escapes are added) - .gsub(ESC_FS, '.') # unescape full stop in troff commands (NOTE must take place after gsub(LeadingPeriodRx)) - .rstrip # strip trailing space + str = str. + gsub(LiteralBackslashRx) { $1 ? $& : '\\(rs' }. # literal backslash (not a troff escape sequence) + gsub(EllipsisCharRefRx, '...'). # horizontal ellipsis + gsub(LeadingPeriodRx, '\\\&.'). # leading . is used in troff for macro call or other formatting; replace with \&. + gsub(EscapedMacroRx) { (rest = $3.lstrip).empty? ? %(.#{$1}"#{$2}") : %(.#{$1}"#{$2.rstrip}"#{LF}#{rest}) }. # drop orphaned \c escape lines, unescape troff macro, quote adjacent character, isolate macro line + gsub('-', '\-'). + gsub('<', '<'). + gsub('>', '>'). + gsub('+', '+'). # plus sign; alternately could use \c(pl + gsub(' ', '\~'). # non-breaking space + gsub('©', '\(co'). # copyright sign + gsub('®', '\(rg'). # registered sign + gsub('™', '\(tm'). # trademark sign + gsub('°', '\(de'). # degree sign + gsub(' ', ' '). # thin space + gsub('–', '\(en'). # en dash + gsub(EmDashCharRefRx, '\(em'). # em dash + gsub('‘', '\(oq'). # left single quotation mark + gsub('’', '\(cq'). # right single quotation mark + gsub('“', '\(lq'). # left double quotation mark + gsub('”', '\(rq'). # right double quotation mark + gsub('←', '\(<-'). # leftwards arrow + gsub('→', '\(->'). # rightwards arrow + gsub('⇐', '\(lA'). # leftwards double arrow + gsub('⇒', '\(rA'). # rightwards double arrow + gsub('', '\:'). # zero width space + gsub('&', '&'). # literal ampersand (NOTE must take place after any other replacement that includes &) + gsub('\'', '\*(Aq'). # apostrophe / neutral single quote + gsub(MockMacroRx, '\1'). # mock boundary + gsub(ESC_BS, '\\'). # unescape troff backslash (NOTE update if more escapes are added) + gsub(ESC_FS, '.'). # unescape full stop in troff commands (NOTE must take place after gsub(LeadingPeriodRx)) + rstrip # strip trailing space opts[:append_newline] ? %(#{str}#{LF}) : str end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/helpers.rb new/lib/asciidoctor/helpers.rb --- old/lib/asciidoctor/helpers.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/helpers.rb 2018-03-20 01:00:00.000000000 +0100 @@ -145,10 +145,13 @@ }) ) end + elsif (CGI = ::CGI).respond_to? :escapeURIComponent + def encode_uri_component str + CGI.escapeURIComponent str + end else - CGI = ::CGI def encode_uri_component str - CGI.escape str + (CGI.escape str).gsub '+', '%20' end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/logging.rb new/lib/asciidoctor/logging.rb --- old/lib/asciidoctor/logging.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/logging.rb 2018-03-20 01:00:00.000000000 +0100 @@ -40,6 +40,7 @@ attr_reader :messages def initialize + super nil self.level = WARN @messages = [] end @@ -67,6 +68,7 @@ attr_reader :max_severity def initialize + super nil self.level = WARN end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/parser.rb new/lib/asciidoctor/parser.rb --- old/lib/asciidoctor/parser.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/parser.rb 2018-03-20 01:00:00.000000000 +0100 @@ -43,6 +43,12 @@ AuthorKeys = ['author', 'authorinitials', 'firstname', 'middlename', 'lastname', 'email'] + ListContinuationMarker = ::Module.new + + ListContinuationPlaceholder = ::String.new.extend ListContinuationMarker + + ListContinuationString = (::String.new LIST_CONTINUATION).extend ListContinuationMarker + # Internal: A Hash mapping horizontal alignment abbreviations to alignments # that can be applied to a table cell (or to all cells in a column) TableCellHorzAlignments = { @@ -555,6 +561,7 @@ # process lines verbatim if style && Compliance.strict_verbatim_paragraphs && (VERBATIM_STYLES.include? style) block_context = style.to_sym + cloaked_context = :paragraph reader.unshift_line this_line # advance to block parsing => break @@ -812,16 +819,17 @@ unless block case block_context when :listing, :source - if block_context == :source || (!attributes[1] && (language = attributes[2] || doc_attrs['source-language'])) - if language + if block_context == :source || (language = attributes[1] ? nil : attributes[2] || doc_attrs['source-language']) + if language # :listing attributes['style'] = 'source' attributes['language'] = language AttributeList.rekey attributes, [nil, nil, 'linenums'] - else + else # :source AttributeList.rekey attributes, [nil, 'language', 'linenums'] if doc_attrs.key? 'source-language' attributes['language'] = doc_attrs['source-language'] end unless attributes.key? 'language' + attributes['cloaked-context'] = cloaked_context unless cloaked_context == :listing end if attributes['linenums-option'] || doc_attrs['source-linenums-option'] attributes['linenums'] = '' @@ -850,6 +858,7 @@ else attributes['language'] = language end + attributes['cloaked-context'] = cloaked_context if attributes['linenums-option'] || doc_attrs['source-linenums-option'] attributes['linenums'] = '' end unless attributes.key? 'linenums' @@ -1420,17 +1429,18 @@ # the termination of the list break if is_sibling_list_item?(this_line, list_type, sibling_trait) + this_line = ListContinuationString if this_line == LIST_CONTINUATION prev_line = buffer.empty? ? nil : buffer[-1] - if prev_line == LIST_CONTINUATION + if ListContinuationMarker === prev_line if continuation == :inactive continuation = :active has_text = true - buffer[-1] = '' unless within_nested_list + buffer[-1] = ListContinuationPlaceholder unless within_nested_list end # dealing with adjacent list continuations (which is really a syntax error) - if this_line == LIST_CONTINUATION + if ListContinuationMarker === this_line if continuation != :frozen continuation = :frozen buffer << this_line @@ -1466,6 +1476,7 @@ break end if interrupt + this_line = nil reader.unshift_lines block_attribute_lines break end @@ -1489,7 +1500,7 @@ (ch0 == '[' && (BlockAttributeLineRx.match? this_line)) || (ch0 == ':' && (AttributeEntryRx.match? this_line)) buffer << this_line else - if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx].match? this_line }) + if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx] =~ this_line }) within_nested_list = true if nested_list_type == :dlist && $3.nil_or_empty? # get greedy again @@ -1510,7 +1521,7 @@ if this_line == LIST_CONTINUATION detached_continuation = buffer.size - buffer << this_line + buffer << ListContinuationString elsif has_text # has_text only relevant for dlist, which is more greedy until it has text for an item; has_text is always true for all other lists # in this block, we have to see whether we stay in the list # TODO any way to combine this with the check after skipping blank lines? @@ -1543,6 +1554,9 @@ buffer << this_line has_text = true end + elsif ListContinuationMarker === this_line + has_text = true + buffer << this_line else has_text = true unless this_line.empty? if (nested_list_type = (within_nested_list ? [:dlist] : NESTABLE_LIST_CONTEXTS).find {|ctx| ListRxMap[ctx] =~ this_line }) @@ -1559,16 +1573,17 @@ reader.unshift_line this_line if this_line - buffer[detached_continuation] = '' if detached_continuation + buffer[detached_continuation] = ListContinuationPlaceholder if detached_continuation until buffer.empty? + # drop optional trailing continuation + if ListContinuationMarker === (last_line = buffer[-1]) + buffer.pop + break # strip trailing blank lines to prevent empty blocks - if (last_line = buffer[-1]).empty? + elsif last_line.empty? buffer.pop else - # drop optional trailing continuation - # (a blank line would have served the same purpose in the document) - buffer.pop if last_line == LIST_CONTINUATION break end end @@ -2399,6 +2414,7 @@ end end + parser_ctx.close_table table.assign_column_widths unless (table.attributes['colcount'] ||= table.columns.size) == 0 || explicit_colspecs table.has_header_option = true if implicit_header table.partition_header_footer attributes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/reader.rb new/lib/asciidoctor/reader.rb --- old/lib/asciidoctor/reader.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/reader.rb 2018-03-20 01:00:00.000000000 +0100 @@ -820,6 +820,10 @@ return line unless @process_lines if line.empty? + if @skipping + shift + return + end @look_ahead += 1 return line end @@ -1039,6 +1043,7 @@ # if running in SafeMode::SECURE or greater, don't process this directive # however, be friendly and at least make it a link to the source document elsif doc.safe >= SafeMode::SECURE + expanded_target = %(pass:c[#{expanded_target}]) if expanded_target.include? ' ' # FIXME we don't want to use a link macro if we are in a verbatim context replace_next_line %(link:#{expanded_target}[role=include]) elsif @maxdepth @@ -1238,7 +1243,10 @@ def resolve_include_path target, attrlist, attributes doc = @document if (Helpers.uriish? target) || (::String === @dir ? nil : (target = %(#{@dir}/#{target}))) - return replace_next_line %(link:#{target}[role=include]) unless doc.attr? 'allow-uri-read' + unless doc.attr? 'allow-uri-read' + target = %(pass:c[#{target}]) if target.include? ' ' + return replace_next_line %(link:#{target}[role=include]) + end if doc.attr? 'cache-uri' # caching requires the open-uri-cached gem to be installed # processing will be automatically aborted if these libraries can't be opened diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/rx.rb new/lib/asciidoctor/rx.rb --- old/lib/asciidoctor/rx.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/rx.rb 2018-03-20 01:00:00.000000000 +0100 @@ -103,6 +103,7 @@ # } # // end::try-catch[] # NOTE m flag is required for Asciidoctor.js + # NOTE the regex checks for \r to account of include files that use Windows newlines TagDirectiveRx = /\b(?:tag|(e)nd)::(\S+?)\[\](?=$|[ \r])/m ## Attribute entries and references @@ -513,12 +514,17 @@ # # https://github.com # https://github.com[GitHub] - # <https://github.com> + # <https://github.com> <= angle brackets not included in autolink # link:https://github.com[] # "https://github.com[]" # (https://github.com) <= parenthesis not included in autolink # - InlineLinkRx = %r((^|link:|#{CG_BLANK}|<|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))m + if RUBY_ENGINE == 'opal' + # NOTE In JavaScript, a back reference succeeds if not set; invert the logic to give it a match to refute + InlineLinkRx = %r((^|link:|#{CG_BLANK}|\\?<(?=\\?(?:https?|file|ftp|irc)(:))|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|(?!\2)([^\s]+?)>|([^\s\[\]<]*([^\s,.?!\[\]<\)])))) + else + InlineLinkRx = %r((^|link:|#{CG_BLANK}|\\?<()|[>\(\)\[\];"'])(\\?(?:https?|file|ftp|irc)://)(?:([^\s\[\]]+)\[(|#{CC_ALL}*?[^\\])\]|\2([^\s]+?)>|([^\s\[\]<]*([^\s,.?!\[\]<\)]))))m + end # Match a link or e-mail inline macro. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/substitutors.rb new/lib/asciidoctor/substitutors.rb --- old/lib/asciidoctor/substitutors.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/substitutors.rb 2018-03-20 01:00:00.000000000 +0100 @@ -445,7 +445,14 @@ # indexterm:[Tigers,Big cats] if (attrlist = normalize_text $2, true, true).include? '=' if (primary = (attrs = (AttributeList.new attrlist, self).parse)[1]) - attrs['terms'] = [primary] + terms = [primary] + if (secondary = attrs[2]) + terms << secondary + if (tertiary = attrs[3]) + terms << tertiary + end + end + attrs['terms'] = terms if (see_also = attrs['see-also']) attrs['see-also'] = (see_also.include? ',') ? (see_also.split ',').map {|it| it.lstrip } : [see_also] end @@ -524,97 +531,100 @@ end if found_colon && (text.include? '://') - # inline urls, target[text] (optionally prefixed with link: and optionally surrounded by <>) + # inline urls, target[text] (optionally prefixed with link: or enclosed in <>) text = text.gsub InlineLinkRx do - if (target = $2 + ($3 || $5)).start_with? RS - # honor the escape - next ($&.slice 0, (rs_idx = $1.length)) + ($&.slice rs_idx + 1, $&.length) - end - - prefix, suffix = $1, '' - # NOTE if $4 is set, we're looking at a formal macro (e.g., https://example.org[]) - if $4 - prefix = '' if prefix == 'link:' - link_text = nil if (link_text = $4).empty? + if $2 && !$5 + # honor the escapes + next $&.slice 1, $&.length if $1.start_with? RS + next %(#{$1}#{$&.slice $1.length + 1, $&.length}) if $3.start_with? RS + next $& unless $6 + doc.register :links, (target = $3 + $6) + link_text = (doc_attrs.key? 'hide-uri-scheme') ? (target.sub UriSniffRx, '') : target + (Inline.new self, :anchor, link_text, type: :link, target: target, attributes: { 'role' => 'bare' }).convert else - # invalid macro syntax (link: prefix w/o trailing square brackets or enclosed in double quotes) - # FIXME we probably shouldn't even get here when the link: prefix is present; the regex is doing too much - case prefix - when 'link:', ?", ?' - next $& - end - case $6 - when ';' - if (prefix.start_with? '<') && (target.end_with? '>') - # move surrounding <> out of URL - prefix = prefix.slice 4, prefix.length - target = target.slice 0, target.length - 4 - elsif (target = target.chop).end_with? ')' - # move trailing ); out of URL - target = target.chop - suffix = ');' - else - # move trailing ; out of URL - suffix = ';' - end - # NOTE handle case when modified target is a URI scheme (e.g., http://) - next $& if target.end_with? '://' - when ':' - if (target = target.chop).end_with? ')' - # move trailing ): out of URL - target = target.chop - suffix = '):' - else - # move trailing : out of URL - suffix = ':' + # honor the escape + next %(#{$1}#{$&.slice $1.length + 1, $&.length}) if $3.start_with? RS + prefix, target, suffix = $1, $3 + ($4 || $7), '' + # NOTE if $5 is set (the attrlist), we're looking at a formal macro (e.g., https://example.org[]) + if $5 + prefix = '' if prefix == 'link:' + link_text = nil if (link_text = $5).empty? + else + case prefix + # invalid macro syntax (link: prefix w/o trailing square brackets or URL enclosed in quotes) + # FIXME we probably shouldn't even get here when the link: prefix is present; the regex is doing too much + when 'link:', ?", ?' + next $& + end + case $8 + when ';' + if (target = target.chop).end_with? ')' + # move trailing ); out of URL + target = target.chop + suffix = ');' + else + # move trailing ; out of URL + suffix = ';' + end + # NOTE handle case when modified target is a bare URI scheme (e.g., http://) + next $& if target == $3 + when ':' + if (target = target.chop).end_with? ')' + # move trailing ): out of URL + target = target.chop + suffix = '):' + else + # move trailing : out of URL + suffix = ':' + end + # NOTE handle case when modified target is a bare URI scheme (e.g., http://) + next $& if target == $3 end - # NOTE handle case when modified target is a URI scheme (e.g., http://) - next $& if target.end_with? '://' end - end - attrs, link_opts = nil, { type: :link } + link_opts = { type: :link } - if link_text - new_link_text = link_text = link_text.gsub ESC_R_SB, R_SB if link_text.include? R_SB - if !doc.compat_mode && (link_text.include? '=') - # NOTE if an equals sign (=) is present, extract attributes from link text - link_text, attrs = extract_attributes_from_text link_text, '' - new_link_text = link_text - link_opts[:id] = attrs['id'] - end + if link_text + new_link_text = link_text = link_text.gsub ESC_R_SB, R_SB if link_text.include? R_SB + if !doc.compat_mode && (link_text.include? '=') + # NOTE if an equals sign (=) is present, extract attributes from link text + link_text, attrs = extract_attributes_from_text link_text, '' + new_link_text = link_text + link_opts[:id] = attrs['id'] + end - if link_text.end_with? '^' - new_link_text = link_text = link_text.chop - if attrs - attrs['window'] ||= '_blank' - else - attrs = { 'window' => '_blank' } + if link_text.end_with? '^' + new_link_text = link_text = link_text.chop + if attrs + attrs['window'] ||= '_blank' + else + attrs = { 'window' => '_blank' } + end end - end - if new_link_text && new_link_text.empty? - # NOTE it's not possible for the URI scheme to be bare in this case + if new_link_text && new_link_text.empty? + # NOTE the modified target will not be a bare URI scheme (e.g., http://) in this case + link_text = (doc_attrs.key? 'hide-uri-scheme') ? (target.sub UriSniffRx, '') : target + bare = true + end + else + # NOTE the modified target will not be a bare URI scheme (e.g., http://) in this case link_text = (doc_attrs.key? 'hide-uri-scheme') ? (target.sub UriSniffRx, '') : target bare = true end - else - # NOTE it's not possible for the URI scheme to be bare in this case - link_text = (doc_attrs.key? 'hide-uri-scheme') ? (target.sub UriSniffRx, '') : target - bare = true - end - if bare - if attrs - attrs['role'] = (attrs.key? 'role') ? %(bare #{attrs['role']}) : 'bare' - else - attrs = { 'role' => 'bare' } + if bare + if attrs + attrs['role'] = (attrs.key? 'role') ? %(bare #{attrs['role']}) : 'bare' + else + attrs = { 'role' => 'bare' } + end end - end - doc.register :links, (link_opts[:target] = target) - link_opts[:attributes] = attrs if attrs - %(#{prefix}#{(Inline.new self, :anchor, link_text, link_opts).convert}#{suffix}) + doc.register :links, (link_opts[:target] = target) + link_opts[:attributes] = attrs if attrs + %(#{prefix}#{(Inline.new self, :anchor, link_text, link_opts).convert}#{suffix}) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/table.rb new/lib/asciidoctor/table.rb --- old/lib/asciidoctor/table.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/table.rb 2018-03-20 01:00:00.000000000 +0100 @@ -300,7 +300,7 @@ # QUESTION is is faster to check for :: before splitting? inner_document_lines = cell_text.split LF, -1 if (unprocessed_line1 = inner_document_lines[0]).include? '::' - preprocessed_lines = (PreprocessorReader.new @document, [unprocessed_line1]).readlines + preprocessed_lines = (PreprocessorReader.new @document, [unprocessed_line1], inner_document_cursor).readlines unless unprocessed_line1 == preprocessed_lines[0] && preprocessed_lines.size < 2 inner_document_lines.shift inner_document_lines.unshift(*preprocessed_lines) unless preprocessed_lines.empty? @@ -659,36 +659,43 @@ end end else - # QUESTION is this right for cells that span columns? - unless (column = @table.columns[@current_row.size]) - logger.error message_with_context 'dropping cell because it exceeds specified number of columns', source_location: @reader.cursor_before_mark - return nil - end + column = @table.columns[@current_row.size] end - cell = Table::Cell.new(column, cell_text, cellspec, cursor: @reader.cursor_before_mark) + cell = Table::Cell.new column, cell_text, cellspec, cursor: (cursor_before_mark = @reader.cursor_before_mark) @reader.mark unless !cell.rowspan || cell.rowspan == 1 activate_rowspan(cell.rowspan, (cell.colspan || 1)) end @column_visits += (cell.colspan || 1) @current_row << cell - # don't close the row if we're on the first line and the column count has not been set explicitly - # TODO perhaps the colcount/linenum logic should be in end_of_row? (or a should_end_row? method) - close_row if end_of_row? && (@colcount != -1 || @linenum > 0 || (eol && i == repeat)) + if (row_status = end_of_row?) > -1 && (@colcount != -1 || @linenum > 0 || (eol && i == repeat)) + if row_status > 0 + logger.error message_with_context 'dropping cell because it exceeds specified number of columns', source_location: cursor_before_mark + close_row true + else + close_row + end + end end @cell_open = false nil end + def close_table + return if @column_visits == 0 + logger.error message_with_context 'dropping cells from incomplete row detected end of table', source_location: @reader.cursor_before_mark + nil + end + private # Internal: Close the row by adding it to the Table and resetting the row # Array and counter variables. # # returns nothing - def close_row - @table.rows.body << @current_row + def close_row drop = false + @table.rows.body << @current_row unless drop # don't have to account for active rowspans here # since we know this is first row @colcount = @column_visits if @colcount == -1 @@ -709,8 +716,10 @@ end # Internal: Check whether we've met the number of effective columns for the current row. + # + # returns -1 if not at end of row, 0 if exactly at end of row, and 1 if overruns end of row def end_of_row? - @colcount == -1 || effective_column_visits == @colcount + @colcount == -1 ? 0 : effective_column_visits <=> @colcount end # Internal: Calculate the effective column visits, which consists of the number of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor/version.rb new/lib/asciidoctor/version.rb --- old/lib/asciidoctor/version.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor/version.rb 2018-03-20 01:00:00.000000000 +0100 @@ -1,4 +1,4 @@ # frozen_string_literal: true module Asciidoctor - VERSION = '2.0.20' + VERSION = '2.0.23' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/asciidoctor.rb new/lib/asciidoctor.rb --- old/lib/asciidoctor.rb 2018-03-20 01:00:00.000000000 +0100 +++ new/lib/asciidoctor.rb 2018-03-20 01:00:00.000000000 +0100 @@ -6,7 +6,6 @@ # this require is satisfied by the Asciidoctor.js build; it augments the Ruby environment for Asciidoctor.js require 'asciidoctor/js' else - autoload :Base64, 'base64' require 'cgi/util' autoload :OpenURI, 'open-uri' autoload :Pathname, 'pathname' @@ -209,13 +208,13 @@ BOM_BYTES_UTF_16BE = [0xfe, 0xff] # The mode to use when opening a file for reading - FILE_READ_MODE = RUBY_ENGINE_OPAL ? 'r' : 'rb:utf-8:utf-8' + FILE_READ_MODE = RUBY_ENGINE_OPAL ? 'r' : 'rb:UTF-8:UTF-8' # The mode to use when opening a URI for reading URI_READ_MODE = FILE_READ_MODE # The mode to use when opening a file for writing - FILE_WRITE_MODE = RUBY_ENGINE_OPAL ? 'w' : 'w:utf-8' + FILE_WRITE_MODE = RUBY_ENGINE_OPAL ? 'w' : 'wb:UTF-8' # The default document type # Can influence markup generated by the converters diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/asciidoctor.1 new/man/asciidoctor.1 --- old/man/asciidoctor.1 2018-03-20 01:00:00.000000000 +0100 +++ new/man/asciidoctor.1 2018-03-20 01:00:00.000000000 +0100 @@ -1,13 +1,13 @@ '\" t .\" Title: asciidoctor .\" Author: Dan Allen, Sarah White -.\" Generator: Asciidoctor 2.0.19 +.\" Generator: Asciidoctor 2.0.22 .\" Date: 2018-03-20 .\" Manual: Asciidoctor Manual -.\" Source: Asciidoctor 2.0.20 +.\" Source: Asciidoctor 2.0.23 .\" Language: English .\" -.TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.20" "Asciidoctor Manual" +.TH "ASCIIDOCTOR" "1" "2018-03-20" "Asciidoctor 2.0.23" "Asciidoctor Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/man/asciidoctor.adoc new/man/asciidoctor.adoc --- old/man/asciidoctor.adoc 2018-03-20 01:00:00.000000000 +0100 +++ new/man/asciidoctor.adoc 2018-03-20 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ = asciidoctor(1) Dan Allen; Sarah White :doctype: manpage -:release-version: 2.0.20 +:release-version: 2.0.23 :man manual: Asciidoctor Manual :man source: Asciidoctor {release-version} ifdef::backend-manpage[:!author:] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2018-03-20 01:00:00.000000000 +0100 +++ new/metadata 2018-03-20 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: asciidoctor version: !ruby/object:Gem::Version - version: 2.0.20 + version: 2.0.23 platform: ruby authors: - Dan Allen @@ -77,14 +77,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: 5.14.0 + version: 5.22.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 5.14.0 + version: 5.22.0 - !ruby/object:Gem::Dependency name: nokogiri requirement: !ruby/object:Gem::Requirement @@ -272,7 +272,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.4.10 +rubygems_version: 3.5.9 signing_key: specification_version: 4 summary: An implementation of the AsciiDoc text processor and publishing toolchain
participants (1)
-
Source-Sync