markup/goldmark: Fail on invalid Markdown attributes

This commit is contained in:
Bjørn Erik Pedersen
2023-03-14 12:45:09 +01:00
parent 0fbab7cbc5
commit b0b1b76dc9
5 changed files with 89 additions and 10 deletions

View File

@@ -392,3 +392,17 @@ func extractPosition(e error) (pos text.Position) {
}
return
}
// TextSegmentError is an error with a text segment attached.
type TextSegmentError struct {
Segment string
Err error
}
func (e TextSegmentError) Unwrap() error {
return e.Err
}
func (e TextSegmentError) Error() string {
return e.Err.Error()
}