summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-11-26 13:20:11 -0700
committerGitHub <noreply@github.com>2023-11-26 13:20:11 -0700
commitd7a6d7b7c725607df2b96663486c278ca01dc0c8 (patch)
treebb337e06cc35b876468e3b5a8ba597bb00596039
parentf1acb3dafbcb7834cc0e6e00f8634f609ff42402 (diff)
resolves #4490 style cells in head row as bold in manpage output (PR #4491)
-rw-r--r--CHANGELOG.adoc1
-rw-r--r--lib/asciidoctor/converter/manpage.rb12
-rw-r--r--test/manpage_test.rb8
3 files changed, 14 insertions, 7 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 45dcb522..259d21d3 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -71,6 +71,7 @@ Bug Fixes::
* Nested dlist attached using list continuation should not consume detached paragraph (#3535)
* Preserve paragraph breaks in normal table cell in manpage output (#4481)
+ * Style cells in head row as bold in manpage output (#4490)
* Escape spaces in include target (using inline passthrough) when generating link from include directive (#4461)
== 2.0.20 (2023-05-18) - @mojavelinux
diff --git a/lib/asciidoctor/converter/manpage.rb b/lib/asciidoctor/converter/manpage.rb
index 3433e8b1..ad855e57 100644
--- a/lib/asciidoctor/converter/manpage.rb
+++ b/lib/asciidoctor/converter/manpage.rb
@@ -473,12 +473,14 @@ r lw(\n(.lu*75u/100u).'
end unless rows.empty?
end
- # NOTE set number of columns and cell defaults
- result << %(#{LF}#{row_header[0].map { 'lt' }.join ' '}.)
- result << LF
- row_text.each do |row|
- result << row.join
+ if node.has_header_option && (header_row_text = row_text[0])
+ result << %(#{LF}#{row_header[0].join ' '}.)
+ result << %(#{LF}#{header_row_text.join})
+ result << '.T&'
+ row_text = row_text.slice 1, row_text.length
end
+ result << %(#{LF}#{row_header[0].map { 'lt' }.join ' '}.#{LF})
+ row_text.each {|row| result << row.join }
result << %(.TE#{LF}.sp)
result.join
end
diff --git a/test/manpage_test.rb b/test/manpage_test.rb
index 6729d850..0feb1469 100644
--- a/test/manpage_test.rb
+++ b/test/manpage_test.rb
@@ -758,10 +758,12 @@ context 'Manpage' do
EOS
expected_coda = <<~'EOS'.chop
allbox tab(:);
- lt.
+ ltB.
T{
Header
T}
+ .T&
+ lt.
T{
Body 1
T}
@@ -814,7 +816,7 @@ context 'Manpage' do
.B Table 1. Table of options
.TS
allbox tab(:);
- lt lt lt.
+ ltB ltB ltB.
T{
Name
T}:T{
@@ -822,6 +824,8 @@ context 'Manpage' do
T}:T{
Default
T}
+ .T&
+ lt lt lt.
T{
dim
T}:T{