Skip to content

Commit

Permalink
resolves #3992 use .bp macro at location of page break in manpage out…
Browse files Browse the repository at this point in the history
…put (PR #3993)
  • Loading branch information
mojavelinux committed Apr 7, 2021
1 parent f21db34 commit 25b1916
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Expand Up @@ -22,6 +22,7 @@ Bug Fixes::
* Remove extra .sp before content of verse block in manpage output
* Fix layout of footnotes in manpage output (#3989)
* Fix formatting of footnote text with URL in manpage output (#3988)
* Use .bp macro at location of page break in manpage output (#3992)

Improvements::

Expand Down
5 changes: 3 additions & 2 deletions lib/asciidoctor/converter/manpage.rb
Expand Up @@ -314,8 +314,9 @@ def convert_open node
end
end

# TODO use Page Control https://www.gnu.org/software/groff/manual/html_node/Page-Control.html#Page-Control
alias convert_page_break skip
def convert_page_break node
'.bp'
end

def convert_paragraph node
if node.title?
Expand Down
26 changes: 26 additions & 0 deletions test/manpage_test.rb
Expand Up @@ -824,6 +824,32 @@
end
end

context 'Page breaks' do
test 'should insert page break at location of page break macro' do
input = <<~EOS.chop
#{SAMPLE_MANPAGE_HEADER}
== Section With Break
before break
<<<
after break
EOS
expected_coda = <<~'EOS'.chop
.SH "SECTION WITH BREAK"
.sp
before break
.bp
.sp
after break
EOS
output = Asciidoctor.convert input, backend: :manpage
assert output.end_with? expected_coda
end
end

context 'Footnotes' do
test 'should generate list of footnotes using numbered list with numbers enclosed in brackets' do
[true, false].each do |standalone|
Expand Down

0 comments on commit 25b1916

Please sign in to comment.