From e5f9937c1d960f4643d6a4431ffa5dd396b26d55 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Mon, 30 Jun 2025 10:45:47 -0500 Subject: [PATCH] docs: escape pipe in typeable command name (#13869) --- book/src/generated/typable-cmd.md | 2 +- xtask/src/docgen.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 219f6b95f..e416e813f 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -78,7 +78,7 @@ | `:log-open` | Open the helix log file. | | `:insert-output` | Run shell command, inserting output before each selection. | | `:append-output` | Run shell command, appending output after each selection. | -| `:pipe`, `:|` | Pipe each selection to the shell command. | +| `:pipe`, `:\|` | Pipe each selection to the shell command. | | `:pipe-to` | Pipe each selection to the shell command, ignoring output. | | `:run-shell-command`, `:sh`, `:!` | Run a shell command | | `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. | diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs index d31c396df..79ecfea12 100644 --- a/xtask/src/docgen.rs +++ b/xtask/src/docgen.rs @@ -36,7 +36,8 @@ pub fn typable_commands() -> Result { "Description".to_owned(), ])); - let cmdify = |s: &str| format!("`:{}`", s); + // escape | so it doesn't get rendered as a column separator + let cmdify = |s: &str| format!("`:{}`", s.replace('|', "\\|")); for cmd in TYPABLE_COMMAND_LIST { let names = std::iter::once(&cmd.name)