diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-11-16 10:46:21 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-11-16 10:46:21 +0300 |
commit | 75b6d66f1d6477e430b21f202d69a07b9d8f67e9 (patch) | |
tree | 338b7fcf55335013a252cd9a875c4a58b461af78 /sphinx/ext/todo.py | |
parent | ef09ea23feaf1d21faa3d5fd990a49fb14642bfa (diff) |
Fix #6738: Use get_encode_func in todo extension
Diffstat (limited to 'sphinx/ext/todo.py')
-rw-r--r-- | sphinx/ext/todo.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index 5da0342f8..d2a8a666d 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -30,7 +30,7 @@ from sphinx.locale import _, __ from sphinx.util import logging from sphinx.util.docutils import SphinxDirective from sphinx.util.nodes import make_refnode -from sphinx.util.texescape import tex_escape_map +from sphinx.util.texescape import get_escape_func from sphinx.writers.html import HTMLTranslator from sphinx.writers.latex import LaTeXTranslator @@ -299,10 +299,11 @@ def depart_todo_node(self: HTMLTranslator, node: todo_node) -> None: def latex_visit_todo_node(self: LaTeXTranslator, node: todo_node) -> None: if self.config.todo_include_todos: + escape = get_escape_func(self.config.latex_engine) self.body.append('\n\\begin{sphinxadmonition}{note}{') self.body.append(self.hypertarget_to(node)) title_node = cast(nodes.title, node[0]) - self.body.append('%s:}' % title_node.astext().translate(tex_escape_map)) + self.body.append('%s:}' % escape(title_node.astext())) node.pop(0) else: raise nodes.SkipNode |