this repo has no description

change if/else-if/else block so switch statement

Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com>

Changed files
+4 -5
internal
converter
+4 -5
internal/converter/markdown.go
··· 117 117 replacement := text 118 118 119 119 for _, feat := range facet.Features { 120 - if feat.Type == "pub.leaflet.richtext.facet#link" { 120 + switch feat.Type { 121 + case "pub.leaflet.richtext.facet#link": 121 122 replacement = fmt.Sprintf("[%s](%s)", text, feat.URI) 122 - } else if feat.Type == "pub.leaflet.richtext.facet#didMention" { 123 + case "pub.leaflet.richtext.facet#didMention": 123 124 replacement = fmt.Sprintf("[%s](https://bsky.app/profile/%s)", text, feat.Did) 124 - } 125 - // code facet? pub.leaflet.richtext.facet#code -> `text` 126 - if feat.Type == "pub.leaflet.richtext.facet#code" { 125 + case "pub.leaflet.richtext.facet#code": 127 126 replacement = fmt.Sprintf("`%s`", text) 128 127 } 129 128 }