comparison docs/details-algpseudocode.rst @ 158:f08d77b8cbf7

Document the default filter "raiseonerror" that is applied by Sphinx by default for lexers
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 08 May 2026 16:44:30 +0200
parents 123aeb2de8aa
children 4ee0b1536ea6
comparison
equal deleted inserted replaced
157:902147c24f9b 158:f08d77b8cbf7
412 app.add_lexer("noend-algpseudocode", 412 app.add_lexer("noend-algpseudocode",
413 partial(AlgPseudocodeLexer, no_end=True)) 413 partial(AlgPseudocodeLexer, no_end=True))
414 414
415 Similarily it works for custom styles and filters. 415 Similarily it works for custom styles and filters.
416 416
417 .. note:: Lexers in Sphinx are instantiated with the `raiseonerror` filter
418 applied by default.
419 This is also true for custom lexers that are added by
420 :py:meth:`Sphinx.add_lexer`.
421
422 Lexer *instances* that are added to
423 :py:data:`sphinx.highlighting.lexers` somehow are taken as is by
424 Sphinx and are not augmented with any default filters.
425
417 For older Sphinx versions your mileage may vary. 426 For older Sphinx versions your mileage may vary.