From 88eef609ab712097ff2b13a2ca45c31ea6fa7df2 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 16 Jul 2018 17:12:31 +0200 Subject: Merge consecutive text nodes when inspecting markdown (#9112) * Fix assertion order expected/actual were in wrong order, resulting in misleading output in case of failing tests * Merge consesutive markdown text nodes This ensures that parser quirks such as "hello!" being parsed as two separate nodes ("hello" and "!") are not exposed to code inspecting a markdown strings. --- utils/markdown/inspect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/markdown/inspect.go') diff --git a/utils/markdown/inspect.go b/utils/markdown/inspect.go index c4e3bf1ac..80b5bc246 100644 --- a/utils/markdown/inspect.go +++ b/utils/markdown/inspect.go @@ -13,7 +13,7 @@ func Inspect(markdown string, f func(interface{}) bool) { } switch v := block.(type) { case *Paragraph: - for _, inline := range v.ParseInlines(referenceDefinitions) { + for _, inline := range MergeInlineText(v.ParseInlines(referenceDefinitions)) { InspectInline(inline, func(inline Inline) bool { return f(inline) }) -- cgit v1.2.3-1-g7c22