Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docx/text/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from __future__ import absolute_import, print_function, unicode_literals, annotations
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, List

from ..enum.style import WD_STYLE_TYPE
from ..enum.text import WD_BREAK
Expand All @@ -17,6 +17,7 @@

if TYPE_CHECKING:
from docx.oxml.text.run import CT_R
from docx.oxml.xmlchemy import MetaOxmlElement

class Run(Parented):
"""
Expand Down Expand Up @@ -204,6 +205,13 @@ def endnotes(self):

return [EndnoteReference(endnoteReference, self) for endnoteReference in self._r.endnoteReference_lst]

def xpath(self, path: str) -> List[MetaOxmlElement]:
"""
Return list of element.
if Element is not wrapped return `_Element` object.
"""
return self._element.xpath(path)

class _Text(object):
"""
Proxy object wrapping ``<w:t>`` element.
Expand Down