diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-26 21:04:28 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-06-26 21:04:28 +0300 |
commit | 7efa9aebb1183dbc9c50a010c0449692c50b3b60 (patch) | |
tree | a5695c570a6f5832d4c3259d9bda46146b006c52 /sphinx/roles.py | |
parent | 03e85df6175258bd6d6ec24aaeed8fc74a335651 (diff) |
Fix #7869: abbr role wrongly copies an explanation from the previous one
Diffstat (limited to 'sphinx/roles.py')
-rw-r--r-- | sphinx/roles.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/roles.py b/sphinx/roles.py index 57d11c269..2ff66d07b 100644 --- a/sphinx/roles.py +++ b/sphinx/roles.py @@ -530,14 +530,15 @@ class Abbreviation(SphinxRole): abbr_re = re.compile(r'\((.*)\)$', re.S) def run(self) -> Tuple[List[Node], List[system_message]]: + options = self.options.copy() matched = self.abbr_re.search(self.text) if matched: text = self.text[:matched.start()].strip() - self.options['explanation'] = matched.group(1) + options['explanation'] = matched.group(1) else: text = self.text - return [nodes.abbreviation(self.rawtext, text, **self.options)], [] + return [nodes.abbreviation(self.rawtext, text, **options)], [] def index_role(typ: str, rawtext: str, text: str, lineno: int, inliner: Inliner, |