# HG changeset patch # User Franz Glasner # Date 1778251470 -7200 # Node ID f08d77b8cbf7aa566466b7f9a963673baba565d4 # Parent 902147c24f9b876f7d78e56ccc523b13eb40cb81 Document the default filter "raiseonerror" that is applied by Sphinx by default for lexers diff -r 902147c24f9b -r f08d77b8cbf7 docs/details-algpseudocode.rst --- a/docs/details-algpseudocode.rst Fri May 08 16:36:11 2026 +0200 +++ b/docs/details-algpseudocode.rst Fri May 08 16:44:30 2026 +0200 @@ -414,4 +414,13 @@ Similarily it works for custom styles and filters. +.. note:: Lexers in Sphinx are instantiated with the `raiseonerror` filter + applied by default. + This is also true for custom lexers that are added by + :py:meth:`Sphinx.add_lexer`. + + Lexer *instances* that are added to + :py:data:`sphinx.highlighting.lexers` somehow are taken as is by + Sphinx and are not augmented with any default filters. + For older Sphinx versions your mileage may vary.