1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

fix: broken markdown by replace \n into <md>

This commit is contained in:
Kenta Yamaguchi
2025-07-06 13:21:54 +09:00
committed by Stefan Haller
parent bc4b50f817
commit b11da414c5
10 changed files with 56 additions and 153 deletions

View File

@ -221,9 +221,12 @@ func formatBinding(binding *types.Binding) string {
action += fmt.Sprintf(" (%s)", binding.Alternative)
}
// Replace newlines with <br> tags for proper markdown table formatting
tooltip := strings.ReplaceAll(binding.Tooltip, "\n", "<br>")
// Use backticks for keyboard keys. Two backticks are needed with an inner space
// to escape a key that is itself a backtick.
return fmt.Sprintf("| `` %s `` | %s | %s |\n", action, description, binding.Tooltip)
return fmt.Sprintf("| `` %s `` | %s | %s |\n", action, description, tooltip)
}
func italicize(str string) string {