Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Fix inline code rendering within bold text
Maximilian Roos2313fc78336d
diff --git a/src/md_help.rs b/src/md_help.rsindex e6b2b024d..3f4760343 100644--- a/src/md_help.rs+++ b/src/md_help.rs@@ -281,7 +281,9 @@ fn render_inline_formatting(line: &str) -> String {}bold_content.push(c);}- result.push_str(&format!("{bold}{bold_content}{bold:#}"));+ // Recursively process inline formatting within bold content+ let processed_content = render_inline_formatting(&bold_content);+ result.push_str(&format!("{bold}{processed_content}{bold:#}"));} else {result.push(ch);}@@ -636,6 +638,16 @@ mod tests {assert!(result.contains("\u{1b}[1m")); // Bold}+ #[test]+ fn test_render_inline_formatting_bold_with_code() {+ // Nested formatting: **`wt list`:** should render code inside bold+ let result = render_inline_formatting("**`wt list`:**");+ assert!(result.contains("wt list"));+ assert!(result.contains("\u{1b}[1m")); // Bold+ assert!(result.contains("\u{1b}[2m")); // Dimmed (for code)+ assert!(!result.contains('`')); // Backticks should be consumed+ }+#[test]fn test_render_inline_formatting_mixed() {let result = render_inline_formatting("text `code` more **bold** end");diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snapindex d1421f488..ac8631caf 100644--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap@@ -106,7 +106,7 @@ Controls where new worktrees are created. The template is relative to the reposiSet persistent flag values for commands. These apply unless explicitly overridden on the command line.-[1m`wt list`:+[1m[2mwt list[0m:[2m[list][2m# All off by default@@ -114,12 +114,12 @@ Set persistent flag values for commands. These apply unless explicitly overridde[2mbranches = true # --branches[2mremotes = true # --remotes-[1m`wt step commit` and `wt merge` staging:+[1m[2mwt step commit[0m and [2mwt merge[0m staging:[2m[commit][2mstage = "all" # "all" (default), "tracked", or "none"-[1m`wt merge`:+[1m[2mwt merge[0m:[2m[merge][2m# These flags are on by default; set to false to disable