diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-12 22:19:46 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-12 22:19:46 +0000 |
| commit | eab369b5721b933c080516fd1dcdfa67e6e2dfcd (patch) | |
| tree | 1693be2772ec9f5c8c3ededb954842983e3d2a84 /mammoth/html_paths.py | |
| parent | 856f9968e15b4efffd9c2ac229263b659576a96e (diff) | |
Read classes on HTML path elements
Diffstat (limited to 'mammoth/html_paths.py')
| -rw-r--r-- | mammoth/html_paths.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mammoth/html_paths.py b/mammoth/html_paths.py index cb53968..0f2184d 100644 --- a/mammoth/html_paths.py +++ b/mammoth/html_paths.py @@ -5,9 +5,11 @@ def path(elements): return HtmlPath(elements) -def element(names): - return HtmlPathElement(names) +def element(names, class_names=None): + if class_names is None: + class_names = [] + return HtmlPathElement(names, class_names) HtmlPath = collections.namedtuple("HtmlPath", ["elements"]) -HtmlPathElement = collections.namedtuple("HtmlPathElement", ["names"]) +HtmlPathElement = collections.namedtuple("HtmlPathElement", ["names", "class_names"]) |
