Man writer: use default middle header when metadata does not...

include `header`.  This change causes pandoc to omit the middle
header parameter when `header` is not set, rather than
emitting `""`.  The parameter is optional and man will use
a default based on the section if it is not specified.

Closes #9943.
This commit is contained in:
John MacFarlane
2024-07-03 16:25:55 -06:00
parent 5604ca612c
commit 60c0149084
3 changed files with 22 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ $endif$
$if(adjusting)$
.ad $adjusting$
$endif$
.TH "$title/nowrap$" "$section/nowrap$" "$date/nowrap$" "$footer/nowrap$" "$header/nowrap$"
.TH "$title/nowrap$" "$section/nowrap$" "$date/nowrap$" "$footer/nowrap$"$if(header)$ "$header/nowrap$"$endif$
$for(header-includes)$
$header-includes$
$endfor$
+20
View File
@@ -0,0 +1,20 @@
```
% pandoc -t man -s -Vpandoc-version=''
---
title: HELLO
section: 1
---
^D
.TH "HELLO" "1" "" ""
```
```
% pandoc -t man -s -Vpandoc-version=''
---
title: HELLO
section: 1
header: Head
---
^D
.TH "HELLO" "1" "" "" "Head"
```
+1 -1
View File
@@ -1,4 +1,4 @@
.TH "Pandoc Test Suite" "" "July 17, 2006" "" ""
.TH "Pandoc Test Suite" "" "July 17, 2006" ""
.PP
This is a set of tests for pandoc.
Most of them are adapted from John Gruber\[cq]s markdown test suite.