Sun May 8 20:24:13 2016, original submission:
Full problem description is also posted at
http://tex.stackexchange.com/questions/308309/problem-breaking-url-when-using-tex4ht-only
This problem only shows up when compiling to HTML.
I have some long URL's and a URL with underscore does not break inside a table cell when compiled to HTML as it does when compiled to PDF. Long URL with hyphens does break correctly. It is only the ones with underscore that do not break as expected.
MWE follows compiled with TL 2015
------------------------------------------
\documentclass[12pt]{article}%
\usepackage{longtable}
\usepackage{hyperref}
\makeatletter %from http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\makeatother
%\usepackage[hyphenbreaks]{breakurl}
%\usepackage[hyphens]{url}
\begin{document}
\begin {longtable}{|p{.2in}|p{2.2in}|p{1in}|p{.8in}|}\hline
1&
\url{http://www.foo.com/questions/aaaaaa/aaaaaaa-aa-aaa-aaaaaaaaa-aaaaaaaaaa-aaaaa-aa-aaaaaaa-aaaaaa}
&
more&1/5/2016
\\\hline
\end{longtable}
Another table
\begin {longtable}{|p{.2in}|p{2.2in}|p{1in}|p{.8in}|}\hline
2&
\url{https://www.foo.com/post/aaa_aaa_aaaa_aaaaaaaa_aaaaa_aa_aaaaaaaaa_aaaaaa_aaa_aaa_aaaaaaaaa_aa_aaaaaaa_aaa_aaaaaaaa_aaaaaaa}
&another good question&1/5/2016\\\hline
\end{longtable}
another one
\begin {longtable}{|p{.2in}|p{2.2in}|p{1in}|p{.8in}|}\hline
1&
aaaaaa aaaaaaa aa aaa aaaaaaaaa aaaaaaaaaa aaaaa aa aaaaaaa
aaaaaa aaaaa aaaaaaaaaa aaaaaaaa aaaaa aaaaaa
aaaaaa aaaaaaa aa aaa aaaaaaaaa aaaaaaaaaa aaaaa aa aaaaaaa
&more&1/5/2016
\\\hline
\end{longtable}
\end{document}
----------------------------
When compiled to PDF, the middle URL breaks correctly, but not when compiled to html, using either make4ht or htlatex
htlatex foo.tex "htm,p-width"
I think the URL should break the same way as it does in PDF. May be there is a workaround?
|