When TinyMCE ist configured to use uids for links, relative urls in PDF with Prince create file:/// links
Issue #5
resolved
The only solution we found for our customer was this transformation:
@registerTransformation def makeResolveUIDLinksAbsolute(root, params, errors): portal_url_tool = getToolByName(params['context'], "portal_url") portal_url = portal_url_tool.getPortalObject().absolute_url() for link in root.xpath('.//a[contains(@href, "resolveuid")]'): old_url = link.attrib['href'] uid_subelement = old_url.split('resolveuid')[-1] link.attrib['href'] = '%s/resolveuid%s' % (portal_url, uid_subelement)
Would you accept a PR and should this be activated by default? The performance impact would be a single xpath query that finds nothing if UID linking is not activated.
Comments (3)
-
repo owner -
repo owner -
repo owner - changed status to resolved
- Log in to comment
Sure, just make a PR