From 4be46ea1449222be87c8ba4aa4d1d02187e5a6d8 Mon Sep 17 00:00:00 2001 From: David Schlachter Date: Thu, 8 Jan 2026 11:35:55 -0500 Subject: Replace apostrophe HTML entity with apostrophe --- ui.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ui.go') diff --git a/ui.go b/ui.go index e4eb311..7857216 100644 --- a/ui.go +++ b/ui.go @@ -147,14 +147,24 @@ func (m model) View() string { } func formatDefinitionForDisplay(policy bluemonday.Policy, definition string, maxWidth int) string { + // Add a hypher to the start of each definition str := strings.ReplaceAll(definition, "
  • ", "
  • - ") + + // Italicize examples str = strings.ReplaceAll(str, "\t
  • \x1b[0m") + + // Remove all HTML tags str = policy.Sanitize(str) + + // Add some colour to the start of each definition str = strings.ReplaceAll(str, "\t- ", "\x1b[0;33;49m•\x1b[0m ") - width := min(maxWidth, 80) + // Replace common HTML entities + str = strings.ReplaceAll(str, "'", "’") + // Wrap + width := min(maxWidth, 80) return wordwrap.String(str, width) } -- cgit v1.2.3