[xep-support] Re: Wrapping long URLs in table cells
Thomas Schraitle
tom_schr at web.de
Fri Aug 11 00:53:04 PDT 2017
Hi Mark,
Am Wed, 9 Aug 2017 22:34:43 -0700
wrote Mark Giffin <mgiffin at earthlink.net>:
> Using XEP 4.21. I have XSL-FO tables that have cells with long URLs
> in them (which are also links), and the URLs get compressed so much
> that they are unreadable. They stay on the same line and do not wrap.
> Is there a way to get them to wrap to the next line? I tried the same
> files with Apache FOP and it just wraps the URLs.
>
> Source XML files are DITA, running through DITA Open Toolkit version
> 2.3.3. But it does the same thing with OT version 1.8.5.
Some time ago, I've implemented an algorithm for DocBook. I wrote a
XSLT template that inserts zero-width space characters before or afters
specific characters.
Although the stylesheet is based on DocBook, I assume it can be easily
adapted to DITA as well:
https://github.com/openSUSE/suse-xsl/blob/develop/suse2013/fo/hyphenate-url.xsl
The template covers some specific things, for example, it doesn't break
before "http://" strings.
You need to define some parameters (ulink.hyphenate.before.chars and
ulink.hyphenate.after.chars) where you can find here:
https://github.com/openSUSE/suse-xsl/blob/develop/suse2013/fo/param.xsl#L399
Hope this gives you some inspirations. :)
Good luck!
--
Gruß/Regards,
Thomas Schraitle
More information about the Xep-support
mailing list