mirror of
https://github.com/alecthomas/chroma.git
synced 2025-11-29 22:47:29 +02:00
Emit error tokens when there's a group mismatch.
Also don't panic/recover, as we no longer use panic to report "real" errors. Fixes #295.
This commit is contained in:
@@ -91,11 +91,6 @@ func (h highlightRanges) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
|
||||
func (h highlightRanges) Less(i, j int) bool { return h[i][0] < h[j][0] }
|
||||
|
||||
func (f *Formatter) Format(w io.Writer, style *chroma.Style, iterator chroma.Iterator) (err error) {
|
||||
defer func() {
|
||||
if perr := recover(); perr != nil {
|
||||
err = perr.(error)
|
||||
}
|
||||
}()
|
||||
return f.writeHTML(w, style, iterator.Tokens())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user