Mercurial > hg > lxmldump
changeset 74:f1fd5a53c341
Fix URLs.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 16 Dec 2021 11:04:20 +0200 |
parents | 4e27677ca5a9 |
children | cac40b08c555 |
files | lxmldump.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lxmldump.py Thu Dec 09 10:35:59 2021 +0200 +++ b/lxmldump.py Thu Dec 16 11:04:20 2021 +0200 @@ -313,12 +313,16 @@ ## Format a "Ptr" node as text def pkk_ptr_to_text(pnode): pfmt = pkk_get_fmt("ptr_fmt") + ptext = ("".join(pnode.itertext())).strip() if pkk_cfg.annotate: ptext = re.sub(r'\s*\.\s*$', '', ptext) + + phref = pnode.attrib["{http://www.w3.org/TR/xlink}href"].replace(" ", "+") + return pfmt.format( text=ptext, - href=pnode.attrib["{http://www.w3.org/TR/xlink}href"]) + href=phref) ## Get text inside a given node