aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-03-14 12:45:09 +0100
committerBjørn Erik Pedersen <[email protected]>2023-03-15 08:54:34 +0100
commitb0b1b76dc9c7edad15924785d01684e36f3e6cdb (patch)
tree85700dca0a8e7307ec168fcee4755c1a561a0f63 /hugolib/page.go
parent0fbab7cbc5a0b57ec875858111b178160d18acb5 (diff)
downloadhugo-b0b1b76dc9c7edad15924785d01684e36f3e6cdb.tar.gz
hugo-b0b1b76dc9c7edad15924785d01684e36f3e6cdb.zip
markup/goldmark: Fail on invalid Markdown attributes
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go8
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)
}