diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 4fd96640e89c..ea652ba91625 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -15,7 +15,7 @@ from pyparsing import ( Combine, Empty, Forward, Group, Literal, oneOf, OneOrMore, Optional, ParseBaseException, ParseFatalException, ParserElement, - ParseResults, QuotedString, Regex, StringEnd, Suppress, ZeroOrMore) + ParseResults, QuotedString, Regex, StringEnd, Suppress, White, ZeroOrMore) import matplotlib as mpl from . import _api, cbook @@ -2058,6 +2058,7 @@ def __init__(self): p.accent <<= Group( Suppress(p.bslash) + oneOf([*self._accent_map, *self._wide_accents]) + + Suppress(Optional(White())) - p.placeable )