diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-03-14 12:45:09 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-03-15 08:54:34 +0100 |
commit | b0b1b76dc9c7edad15924785d01684e36f3e6cdb (patch) | |
tree | 85700dca0a8e7307ec168fcee4755c1a561a0f63 /hugolib/page.go | |
parent | 0fbab7cbc5a0b57ec875858111b178160d18acb5 (diff) | |
download | hugo-b0b1b76dc9c7edad15924785d01684e36f3e6cdb.tar.gz hugo-b0b1b76dc9c7edad15924785d01684e36f3e6cdb.zip |
markup/goldmark: Fail on invalid Markdown attributes
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index a80b28a3e..ebc29df47 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -617,7 +617,13 @@ func (p *pageState) wrapError(err error) error { } } - return herrors.NewFileErrorFromFile(err, filename, p.s.SourceSpec.Fs.Source, herrors.NopLineMatcher) + lineMatcher := herrors.NopLineMatcher + + if textSegmentErr, ok := err.(*herrors.TextSegmentError); ok { + lineMatcher = herrors.ContainsMatcher(textSegmentErr.Segment) + } + + return herrors.NewFileErrorFromFile(err, filename, p.s.SourceSpec.Fs.Source, lineMatcher) } |