diff options
Diffstat (limited to 'hugolib')
-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) } |