diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -149,17 +149,13 @@ func (m model) View() string { } func formatDefinitionForDisplay(policy bluemonday.Policy, definition string) string { - return wordwrap.String( - strings.ReplaceAll( - whitespaceTrimmerRe.ReplaceAllLiteralString( - policy.Sanitize(definition), - "", - ), - "\n\n", - "\n", - ), - 72, - ) + str := strings.ReplaceAll(definition, "<li class=sense>", "<li class=sense>- ") + str = strings.ReplaceAll(str, "\t<ul><li><i>", "\n\t<ul><li><i>\x1b[3;39;49m") + str = strings.ReplaceAll(str, "</i></li></ul></li>", "</i></li></ul></li>\x1b[0m") + str = policy.Sanitize(str) + str = strings.ReplaceAll(str, "\t- ", "\x1b[0;33;49m•\x1b[0m ") + + return wordwrap.String(str, 72) } func formatStatus(lastError error, lastSuccess string) string { |
