summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-05-13 08:13:05 -0400
committerAndrew Gallant <jamslam@gmail.com>2020-05-13 08:13:05 -0400
commit1980630f1770da3d7d392dc3b743d04018217e34 (patch)
tree581d11d5a57d9ffa51096e579308728b3c7a44d2 /build.rs
parent1e9a481a66c3804b772c2cdf4fb1e478384fe6e0 (diff)
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
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 6fa7c1ac..b4b62b9c 100644
--- a/build.rs
+++ b/build.rs
@@ -217,6 +217,10 @@ fn formatted_doc_txt(arg: &RGArg) -> io::Result<String> {
.doc_long
.replace("{", "&#123;")
.replace("}", r"&#125;")
+ // 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();