RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
package utility
import "testing"
func TestStripMarkdownImages(t *testing.T) {
for _, tc := range []struct {
name, text, want string
}{
{"plain image", "", ""},
{"parenthesized filename", ".png)", ""},
{"multiple parentheses", "/img_(1).png)", ""},
{"surrounding text", "before .png) after", "before after"},
{"multiple images", ".png) .png)", " "},
{"html image", `<div><img src="a(1).png"></div>`, ""},
{"regular link", "[a](http://x/img_(1).png)", "[a](http://x/img_(1).png)"},
} {
t.Run(tc.name, func(t *testing.T) {
if got := StripMarkdownImages(tc.text); got != tc.want {
t.Fatalf("got=%q want=%q", got, tc.want)
}
})
}
}