~elektito/gemplex

d1df4915f2d9be884cdf5ba155898b3ace61f128 — Mostafa Razavi 7 months ago c906efb
Cleanup alt-text and pre a little
1 files changed, 2 insertions(+), 0 deletions(-)

M pkg/gparse/gparse.go
M pkg/gparse/gparse.go => pkg/gparse/gparse.go +2 -0
@@ 128,6 128,7 @@ func ParseGemtext(text string, base *url.URL) (result Page) {
		if len(matches) > 0 {
			if !inPre {
				altText = matches[1]
				altText = strings.TrimSpace(altText)
				if altText != "" {
					s.WriteString(altText + "\n")
				}


@@ 158,6 159,7 @@ func ParseGemtext(text string, base *url.URL) (result Page) {

		if inPre {
			preLineCount++
			line = strings.TrimRight(line, "\r")
			preAll += line + "\n"
			if isMostlyAlphanumeric(line) {
				preText += line + "\n"