git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 3/3] asciidoctor-extensions: fix spurious space after linkgit

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2019, 09:26 UTC
Message-ID
<20190311092605.259322-3-gitster@pobox.com>
In-Reply-To
<20190311092605.259322-1-gitster@pobox.com>
From: Martin Ågren <martin.agren@gmail.com>

When we render, e.g., "linkgit:gitglossary[7]." with Asciidoctor, we get "gitglossary(7) ." with a space between the linkgit macro expansion and the punctuation. We can fix this by dropping the trailing newline after we've turned `linkgit:foo[bar]` into `<citerefentry>..</citerefentry>`.

The diff produced by `USE_ASCIIDOCTOR=Yes ./doc-diff HEAD^ HEAD` is almost 6000 lines large and shows how this fixes "git-foo(x) ,", "(see git-bar(y) )" and so on. One might wonder whether this also turns, e.g., "see linkgit:foo[1] for more" into "see foo(1)for more", but no. We get "...</citerefentry> for more" in the XML, see, e.g., git-am.xml, so the space ends up in git-am.1 just fine. The same is true for the HTML output.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/asciidoctor-extensions.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb
index ec83b4959e..0089e0cfb8 100644
--- a/Documentation/asciidoctor-extensions.rb
+++ b/Documentation/asciidoctor-extensions.rb
@@ -11,12 +11,12 @@ module Git
       def process(parent, target, attrs)
         if parent.document.basebackend? 'html'
           prefix = parent.document.attr('git-relative-html-prefix')
-          %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n)
+          %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>)
         elsif parent.document.basebackend? 'docbook'
           "<citerefentry>\n" \
             "<refentrytitle>#{target}</refentrytitle>" \
             "<manvolnum>#{attrs[1]}</manvolnum>\n" \
-          "</citerefentry>\n"
+          "</citerefentry>"
         end
       end
     end
-- 
2.21.0-155-ge902e9bcae
Previous: Junio C HamanoNext: Martin Ågren
Message 30 of 31 in “asciidoctor-extensions: fix spurious space after linkgit”
  1. 0/3 asciidoctor-extensions: fix spurious space after linkgitMartin Ågren, Feb 25, 2019
  2. 1/3 Documentation/Makefile: add missing xsl dependencies for manpagesMartin Ågren, Feb 25, 2019
  3. Eric SunshineFeb 25, 2019
  4. Martin ÅgrenFeb 25, 2019
  5. Eric SunshineFeb 25, 2019
  6. Martin ÅgrenFeb 26, 2019
  7. Eric SunshineFeb 26, 2019
  8. Martin ÅgrenFeb 27, 2019
  9. 2/3 Documentation/Makefile: add missing dependency on asciidoctor-extensionsMartin Ågren, Feb 25, 2019
  10. 3/3 asciidoctor-extensions: fix spurious space after linkgitMartin Ågren, Feb 25, 2019
  11. brian m. carlsonFeb 26, 2019
  12. brian m. carlsonFeb 26, 2019
  13. Martin ÅgrenFeb 26, 2019
  14. 0/3 asciidoctor-extensions: fix spurious space after linkgitMartin Ågren, Feb 27, 2019
  15. 1/3 Documentation/Makefile: add missing xsl dependencies for manpagesMartin Ågren, Feb 27, 2019
  16. 2/3 Documentation/Makefile: add missing dependency on asciidoctor-extensionsMartin Ågren, Feb 27, 2019
  17. 3/3 asciidoctor-extensions: fix spurious space after linkgitMartin Ågren, Feb 27, 2019
  18. brian m. carlsonFeb 28, 2019
  19. Junio C HamanoMar 3, 2019
  20. 0/2 fix spurious space after linkgit, now in *.htmlMartin Ågren, Mar 10, 2019
  21. 1/2 Documentation/Makefile: add missing dependencies on asciidoctor-extensionsMartin Ågren, Mar 10, 2019
  22. 2/2 asciidoctor-extensions: fix spurious space after linkgit in *.htmlMartin Ågren, Mar 10, 2019
  23. Jeff KingMar 11, 2019
  24. Martin ÅgrenMar 11, 2019
  25. Junio C HamanoMar 11, 2019
  26. Martin ÅgrenMar 11, 2019
  27. Junio C HamanoMar 11, 2019
  28. 1/3 Documentation/Makefile: add missing xsl dependencies for manpagesJunio C Hamano, Mar 11, 2019
  29. 2/3 Documentation/Makefile: add missing dependency on asciidoctor-extensionsJunio C Hamano, Mar 11, 2019
  30. 3/3 asciidoctor-extensions: fix spurious space after linkgitJunio C Hamano, Mar 11, 2019
  31. Martin ÅgrenMar 11, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.