fix: first sentence of some descriptions cut off
1 file changed, 3 insertions(+), 3 deletions(-)
changed files
M internal/components/markdown.go → internal/components/markdown.go
@@ -4,11 +4,11 @@ import ( "regexp" ) -var firstSentenceRegexp = regexp.MustCompile(`^.+?(\.[[:space:]]|:\n)`) +var firstSentenceRegexp = regexp.MustCompile(`^((?s).+?)(?:\.[[:space:]]*[[:upper:]])`) func firstSentence[T ~string](text T) T { - if fs := firstSentenceRegexp.FindString(string(text)); fs != "" { - return T(fs) + if fs := firstSentenceRegexp.FindStringSubmatch(string(text)); len(fs) > 0 && fs[1] != "" { + return T(fs[1]) } return text