comparison docs/filters.rst @ 270:cb66de44a7b9

Make the filter order more logical. Because the ErrorToGenericErrorTokenFilter is implemented as an application of the TokenReplaceFilter document the TokenReplaceFilter first.
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 19 May 2026 22:59:59 +0200
parents 9790553d7225
children 315e94bac8a7
comparison
equal deleted inserted replaced
269:9790553d7225 270:cb66de44a7b9
60 functools.partial( 60 functools.partial(
61 AlgPseudocodeLexer, 61 AlgPseudocodeLexer,
62 filters=[ErrorToGenericErrorTokenFilter])) 62 filters=[ErrorToGenericErrorTokenFilter]))
63 63
64 64
65 ErrorToGenericErrorTokenFilter
66 ==============================
67
68 :Name: errortogenericerror
69 :Filter Options: none
70
71 Replace all :py:class:`pygments.token.Token.Error` tokens in a stream by
72 :py:class:`pygments.token.Token.Generic.Error` tokens.
73
74
75 TokenReplaceFilter 65 TokenReplaceFilter
76 ================== 66 ==================
77 67
78 :Name: tokenreplace 68 :Name: tokenreplace
79 :Filter Options: 69 :Filter Options:
101 91
102 Replace all token types given as `replacements` keys or in `token_from` 92 Replace all token types given as `replacements` keys or in `token_from`
103 with the token types given in `replacements` values or in `token_to`. 93 with the token types given in `replacements` values or in `token_to`.
104 94
105 The values in the token stream are retained. 95 The values in the token stream are retained.
96
97
98 ErrorToGenericErrorTokenFilter
99 ==============================
100
101 :Name: errortogenericerror
102 :Filter Options: none
103
104 Replace all :py:class:`pygments.token.Token.Error` tokens in a stream by
105 :py:class:`pygments.token.Token.Generic.Error` tokens.
106
107 The filter is implemented as an application of the `TokenReplaceFilter`_.