如何转义双反斜杠以便我可以在手册页中获得“\\”?
How to escape double backslashes so I can get "\\" in man page?
例如,我的 foo.adoc
文件如下所示:
= foo(1)
== NAME
foo - hello world
== SYNOPSIS
foo ...
== DESCRIPTION
\ | \\ | \\ | {backslash}{backslash}
但在 asciidoctor -b manpage foo.adoc
和 man ./foo.1
之后会产生:
FOO(1) FOO(1)
NAME
foo - hello world
SYNOPSIS
foo ...
DESCRIPTION
\ | \(rs | \(rs | \
2019-07-03 FOO(1)
那么我应该如何避免在手册页中出现双反斜杠 (\
)?
这实际上是 Asciidoctor 中的一个错误:
The regular expression that is used to preserve literal backslashes is malfunctioning. The backslash in the content is somehow getting mixed up with the backslash in the replacement. And we're also missing a test.
-- @mojavelinux
https://github.com/asciidoctor/asciidoctor/issues/3456
应该会在 Asciidoctor 的下一个版本 (2.0.11) 中修复。
例如,我的 foo.adoc
文件如下所示:
= foo(1)
== NAME
foo - hello world
== SYNOPSIS
foo ...
== DESCRIPTION
\ | \\ | \\ | {backslash}{backslash}
但在 asciidoctor -b manpage foo.adoc
和 man ./foo.1
之后会产生:
FOO(1) FOO(1)
NAME
foo - hello world
SYNOPSIS
foo ...
DESCRIPTION
\ | \(rs | \(rs | \
2019-07-03 FOO(1)
那么我应该如何避免在手册页中出现双反斜杠 (\
)?
这实际上是 Asciidoctor 中的一个错误:
The regular expression that is used to preserve literal backslashes is malfunctioning. The backslash in the content is somehow getting mixed up with the backslash in the replacement. And we're also missing a test.
-- @mojavelinux
https://github.com/asciidoctor/asciidoctor/issues/3456
应该会在 Asciidoctor 的下一个版本 (2.0.11) 中修复。