Currently asciidoctor doesn't convert number character references (&#xx;) correctly for man pages. This hack fixes the issue with minimum changes elsewhere so it's easy to remove when fixed. Fixes doc-diffs like: so line count cannot be shown) and there is no difference between indexed copy and the working tree version (if the working tree version were also different, binary would have been shown in place - of nothing). The other file, git-add--interactive.perl, has 403 - lines added and 35 lines deleted if you commit what is in the - index, but working tree file has further modifications (one + of nothing). The other file, git-add--interactive.perl, + has 403 lines added and 35 lines deleted if you commit what is in + the index, but working tree file has further modifications (one addition and one deletion). https://github.com/asciidoctor/asciidoctor/issues/4059 Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- Documentation/asciidoctor-extensions.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index ad68f7b0bb..11937c2c1d 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -45,6 +45,17 @@ module Git end Asciidoctor::Extensions.register do + # Override attributes for man pages. + # https://github.com/asciidoctor/asciidoctor/issues/4059 + tree_processor do + process do |document| + if document.backend == 'manpage' + document.attributes.merge!({ 'litdd' => '\--', 'plus' => '+' }) + end + document + end + end + inline_macro Git::Documentation::LinkGitProcessor, :linkgit postprocessor Git::Documentation::DocumentPostProcessor end -- 2.31.1