diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2018-05-02 19:08:56 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-02 19:08:56 -0600 |
| commit | 75fa4f702405dea68aa010044fff7bd229e7d666 (patch) | |
| tree | 2e968bea39ac1b86957395138ea1a29febf31ddf | |
| parent | e2583ced0056d8dda002df218f6089b92d0d3805 (diff) | |
| parent | 157cb704668651845ee99751c1c22ebf233bb5d7 (diff) | |
resolves #2751 use alternate macro to switch on monospaced text (PR #2752)
resolves #2751 use alternate macro to switch on monospaced text
| -rw-r--r-- | CHANGELOG.adoc | 1 | ||||
| -rw-r--r-- | lib/asciidoctor/converter/manpage.rb | 2 | ||||
| -rw-r--r-- | test/manpage_test.rb | 13 |
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 60bdde71..dc2ce606 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -80,6 +80,7 @@ Bug fixes:: * don't convert inter-document xref to internal anchor unless entire target file is included into current file (#2200) * fix em dash replacement in manpage converter (#2604, PR #2607) * don't output e-mail address twice when replacing bare e-mail address in manpage output (#2654, PR #2665) + * use alternate macro for monospaced text in manpage output to not conflict w/ AsciiDoc macros (#2751) * enforce that absolute start path passed to PathResolver#system_path is inside of jail path (#2642, PR #2644) * fix behavior of PathResolver#descends_from? when base path equals / (#2642, PR #2644) * automatically recover if start path passed to PathResolver#system_path is outside of jail path (#2642, PR #2644) diff --git a/lib/asciidoctor/converter/manpage.rb b/lib/asciidoctor/converter/manpage.rb index 31c09c2b..56fddd7f 100644 --- a/lib/asciidoctor/converter/manpage.rb +++ b/lib/asciidoctor/converter/manpage.rb @@ -680,7 +680,7 @@ allbox tab(:);' when :strong %(#{ESC_BS}fB<BOUNDARY>#{node.text}</BOUNDARY>#{ESC_BS}fP) when :monospaced - %(#{ESC_BS}f[CR]<BOUNDARY>#{node.text}</BOUNDARY>#{ESC_BS}fP) + %[#{ESC_BS}f(CR<BOUNDARY>#{node.text}</BOUNDARY>#{ESC_BS}fP] when :single %[#{ESC_BS}(oq<BOUNDARY>#{node.text}</BOUNDARY>#{ESC_BS}(cq] when :double diff --git a/test/manpage_test.rb b/test/manpage_test.rb index f09705b5..1a248dc4 100644 --- a/test/manpage_test.rb +++ b/test/manpage_test.rb @@ -150,7 +150,7 @@ BBB this line and the one above it should be visible) "`hello`" '`goodbye`' *strong* _weak_ `even`) output = Asciidoctor.convert input, :backend => :manpage - assert_equal '\(lqhello\(rq \(oqgoodbye\(cq \fBstrong\fP \fIweak\fP \f[CR]even\fP', output.lines.entries.last.chomp + assert_equal '\(lqhello\(rq \(oqgoodbye\(cq \fBstrong\fP \fIweak\fP \f(CReven\fP', output.lines.entries.last.chomp end test 'should escape backslashes in content' do @@ -268,6 +268,17 @@ Please search |\c .URL "http://discuss.asciidoctor.org" "the forums" "|" before asking.', output.lines.entries[-4..-1].join end + + test 'should be able to use monospaced text inside a link' do + input = %(#{SAMPLE_MANPAGE_HEADER} + +Enter the link:cat[`cat`] command.) + output = Asciidoctor.convert input, :backend => :manpage + assert_equal '.sp +Enter the \c +.URL "cat" "\f(CRcat\fP" " " +command.', output.lines.entries[-4..-1].join + end end context 'MTO macro' do |
