A tool for archiving & converting scans of postcards, and information about them.

fix: Correct HTML output for underline Annotation

+12 -2
+12 -2
types/annotations.go
··· 86 86 return outHTML.String() 87 87 } 88 88 89 + var htmlMap = map[AnnotationType]string{ 90 + ATEmphasis: "em", 91 + ATStrong: "strong", 92 + ATUnderline: "underline", 93 + } 94 + 89 95 func (a Annotation) HTMLTag(isOpen bool) string { 90 96 switch a.Type { 91 97 case ATLocale: ··· 95 101 return "</span>" 96 102 } 97 103 default: 104 + tag, ok := htmlMap[a.Type] 105 + if !ok { 106 + return "" 107 + } 98 108 if isOpen { 99 - return fmt.Sprintf("<%s>", a.Type) 109 + return fmt.Sprintf("<%s>", tag) 100 110 } else { 101 - return fmt.Sprintf("</%s>", a.Type) 111 + return fmt.Sprintf("</%s>", tag) 102 112 } 103 113 } 104 114 }