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.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
940d0bbbc2
Коммит
88eef609ab
@@ -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)
|
||||
})
|
||||
|
||||
Ссылка в новой задаче
Block a user