From 98d59ba4e06636628e6b18d2caef5ae5ba0fa1f3 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 20 Feb 2021 01:20:43 +0000 Subject: [PATCH] don't strip text on images --- stripmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripmd.go b/stripmd.go index c016cfa..0fb6e96 100644 --- a/stripmd.go +++ b/stripmd.go @@ -20,7 +20,7 @@ func stripMarkdown(md string) string { if !foundOpenSquare && !foundOpen && c != '[' && c != ']' { continue } - if c == '[' { + if c == '[' && md[i-1] != '!' { foundOpenSquare = true openSquare = i } else if c == ']' {