mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-01 04:32:01 -07:00
doc: fix egregious markup output
We use '+++' syntax to output a literal '**' for a '--glob' example. This '+++' syntax is pretty ugly when rendered literally via --help. We fix this by hackily inserting the '+++' syntax for its one specific case that we need it during man page generation. Not ideal but it works. And --help still has some '*foo*' markup, but we live with that for now. Fixes #1581
This commit is contained in:
4
build.rs
4
build.rs
@@ -217,6 +217,10 @@ fn formatted_doc_txt(arg: &RGArg) -> io::Result<String> {
|
||||
.doc_long
|
||||
.replace("{", "{")
|
||||
.replace("}", r"}")
|
||||
// Hack to render ** literally in man page correctly. We can't put
|
||||
// these crazy +++ in the help text directly, since that shows
|
||||
// literally in --help output.
|
||||
.replace("*-g 'foo/**'*", "*-g +++'foo/**'+++*")
|
||||
.split("\n\n")
|
||||
.map(|s| s.to_string())
|
||||
.collect();
|
||||
|
Reference in New Issue
Block a user