mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Monkey-patch docutils.nodes.Element.copy to copy the rawsource.
This commit is contained in:
parent
bd1c19d724
commit
f7a418949a
@ -136,3 +136,10 @@ def _new_contains(self, key):
|
||||
return key in self.children
|
||||
|
||||
nodes.Node.__contains__ = _new_contains
|
||||
|
||||
# monkey-patch Element.copy to copy the rawsource
|
||||
|
||||
def _new_copy(self):
|
||||
return self.__class__(self.rawsource, **self.attributes)
|
||||
|
||||
nodes.Element.copy = _new_copy
|
||||
|
Loading…
Reference in New Issue
Block a user