Skip to content

Commit

Permalink
Do not typeset table headings in monospaced font
Browse files Browse the repository at this point in the history
Table headings typeset in monospaced font look ugly (this can only be
seen when rendered into Postscript or PDF). Using bold font is enough.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Apr 17, 2023
1 parent 88f3fbc commit 65a740a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions md2man/roff.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ func (r *roffRenderer) handleTableCell(w io.Writer, node *blackfriday.Node, ente
start = "\t"
}
if node.IsHeader {
start += codespanTag
start += strongTag
} else if nodeLiteralSize(node) > 30 {
start += tableCellStart
}
out(w, start)
} else {
var end string
if node.IsHeader {
end = codespanCloseTag
end = strongCloseTag
} else if nodeLiteralSize(node) > 30 {
end = tableCellEnd
}
Expand Down
6 changes: 3 additions & 3 deletions md2man/roff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func TestTable(t *testing.T) {
allbox;
l l
l l .
\fB\fCAnimal\fR \fB\fCColor\fR
\fBAnimal\fP \fBColor\fP
elephant T{
Gray. The elephant is very gray.
T}
Expand Down Expand Up @@ -286,7 +286,7 @@ func TestTableWithEmptyCell(t *testing.T) {
allbox;
l l l
l l l .
\fB\fCCol1\fR \fB\fCCol2\fR \fB\fCCol3\fR
\fBCol1\fP \fBCol2\fP \fBCol3\fP
row one
row two x
.TE
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestTableWrapping(t *testing.T) {
allbox;
l l
l l .
\fB\fCCol1\fR \fB\fCCol2\fR
\fBCol1\fP \fBCol2\fP
row one This is a short line.
row|two Col1 should not wrap.
row three no|wrap
Expand Down

0 comments on commit 65a740a

Please sign in to comment.