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.
Этот коммит содержится в:
Adrian
2018-07-16 17:12:31 +02:00
коммит произвёл Joram Wilander
родитель 940d0bbbc2
Коммит 88eef609ab
3 изменённых файлов: 57 добавлений и 23 удалений

Просмотреть файл

@@ -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)
})