From: Junio C Hamano Date: Tue, 01 Apr 2025 21:48:00 GMT Subject: Re: [PATCH] doc: fix asciidoctor synopsis processing of triple-dots Message-ID: In-Reply-To: <20250401110811.117851-1-jn.avila@free.fr> Jean-Noël Avila writes: > The processing of triple dot notation is tricky because it can be > mis-interpreted as an ellipsis. > > Another issue is that the formatting of synopsis paragraph in > Asciidoctor spits out another asciidoc formatted text where verbatim > text formatted with backquotes must have surrounding separators in > order to be properly detected, even if they are sticking to another > text. > > The special processing of the ellipsis is now complete and takes into > account the case of `git-mv ... ` > > Signed-off-by: Jean-Noël Avila > --- > Documentation/asciidoctor-extensions.rb.in | 8 +++++--- > Documentation/diff-generate-patch.adoc | 2 +- > 2 files changed, 6 insertions(+), 4 deletions(-) The .gsub() changes seem to interact with your "doc: fix synopsis analysis logic" in the series that updates reset/mv/rm documentation mark-up. > diff --git a/Documentation/asciidoctor-extensions.rb.in b/Documentation/asciidoctor-extensions.rb.in > index 2494f17a51..0ded90c28b 100644 > --- a/Documentation/asciidoctor-extensions.rb.in > +++ b/Documentation/asciidoctor-extensions.rb.in > @@ -49,7 +49,7 @@ module Git > > def process parent, reader, attrs > outlines = reader.lines.map do |l| > - l.gsub(/(\.\.\.?)([^\]$.])/, '`\1`\2') > + l.gsub(/(\.\.\.?)([^\]$\. ])/, '{empty}`\1`{empty}\2') > .gsub(%r{([\[\] |()>]|^)([-a-zA-Z0-9:+=~@,/_^\$]+)}, '\1{empty}`\2`{empty}') > .gsub(/(<[-a-zA-Z0-9.]+>)/, '__\\1__') > .gsub(']', ']{empty}') > @@ -72,6 +72,7 @@ module Git > %() > elsif type == :monospaced > node.text.gsub(/(\.\.\.?)([^\]$.])/, '\1\2') > + .gsub(/^\.\.\.?$/, '\0\2') > .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@,/_^\$]+\.{0,2})+)}, '\1\2') > .gsub(/(<[-a-zA-Z0-9.]+>)/, '\1') > else > @@ -100,8 +101,9 @@ module Git > def convert_inline_quoted node > if node.type == :monospaced > node.text.gsub(/(\.\.\.?)([^\]$.])/, '\1\2') > - .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@,/_^\$]+\.{0,2})+)}, '\1\2') > - .gsub(/(<[-a-zA-Z0-9.]+>)/, '\1') > + .gsub(/^\.\.\.?$/, '\0') > + .gsub(%r{([\[\s|()>.]|^|\]|>)(\.?([-a-zA-Z0-9:+=~@,/_^\$]+\.{0,2})+)}, '\1\2') > + .gsub(/(<[-a-zA-Z0-9.]+>)/, '\1') > > else > open, close, tag = QUOTE_TAGS[node.type] > diff --git a/Documentation/diff-generate-patch.adoc b/Documentation/diff-generate-patch.adoc > index e5c813c96f..7b6cdd1980 100644 > --- a/Documentation/diff-generate-patch.adoc > +++ b/Documentation/diff-generate-patch.adoc > @@ -138,7 +138,7 @@ or like this (when the `--cc` option is used): > + > [synopsis] > index ,.. > -mode ,`..` > +mode ,.. > new file mode > deleted file mode , > +