Bug 128358 - URL containing parentheses don't work
Summary: URL containing parentheses don't work
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdvi
Classification: Unmaintained
Component: general (show other bugs)
Version: 1.3
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 11:23 UTC by Matthias Habl
Modified: 2013-09-28 13:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
LaTeX file (484 bytes, text/plain)
2006-05-31 12:09 UTC, Matthias Habl
Details
DVI file (2.70 KB, application/octet-stream)
2006-05-31 12:10 UTC, Matthias Habl
Details
PDF file (19.04 KB, application/octet-stream)
2006-05-31 12:10 UTC, Matthias Habl
Details
C function (2.07 KB, text/plain)
2006-08-01 23:39 UTC, Matthias Habl
Details
LaTeX (662 bytes, text/plain)
2006-09-09 12:45 UTC, Matthias Habl
Details
DVI (2.87 KB, application/octet-stream)
2006-09-09 12:47 UTC, Matthias Habl
Details
PDF (12.36 KB, application/octet-stream)
2006-09-09 12:48 UTC, Matthias Habl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Habl 2006-05-31 11:23:37 UTC
Version:           1.3 (using KDE KDE 3.4.2)
Installed from:    Debian stable Packages
OS:                Linux

Kdvi doesn't handle weblinks which contain parentheses correctly. Everything after '(' (including the opening parenthesis) is simply dropped. This seems not to be a problem of the LaTeX package hyperref because with -> ps -> pdf you get a file which works fine with acrobat.

Here is a minimal example:

\documentclass{article}

\usepackage{hyperref}

\begin{document}

A link that contains ``(...)'',
\vskip3mm
\hskip5mm\href{http://dx.doi.org/10.1016/0040-6090(83)90097-4}{http://dx.doi.org/10.1016/0040-6090(83)90097-4}
\vskip3mm
works with Acrobat, but \textbf{not with kdvi}.

\vskip2cm


Without ``(...)'', a link, e.g.,
\vskip3mm
\hskip5mm\href{http://dx.doi.org/10.1063/1.1479746}{http://dx.doi.org/10.1063/1.1479746}
\vskip3mm
works with both Acrobat and kdvi.


\end{document}
Comment 1 Matthias Habl 2006-05-31 12:09:38 UTC
Created attachment 16372 [details]
LaTeX file
Comment 2 Matthias Habl 2006-05-31 12:10:11 UTC
Created attachment 16373 [details]
DVI file
Comment 3 Matthias Habl 2006-05-31 12:10:34 UTC
Created attachment 16374 [details]
PDF file
Comment 4 Matthias Habl 2006-07-29 00:08:29 UTC
I have now encountered the same problem with xdvik (http://sourceforge.net/projects/xdvi). Obviously, the parser stops just before the second parenthesis, yielding "http://dx.doi.org/10.1016/0040-6090(83".

Die PostScript interpreter doesn't so. As the parentheses in

SDict begin [ /H /I /Border [16 16 2] /Color [0 1 1] /Action << /Subtype
/URI /URI (http://dx.doi.org/10.1016/0039-6028(86)90835-6) >> /Subtype
/Link H.B /ANN pdfmark end

are balanced, the whole URL is extracted. I think that the behavior of kdvi and xdvik should be changed in order to fully match the syntax of PostScript.
Comment 5 Matthias Habl 2006-08-01 23:34:55 UTC
I have written a general PostScript parser for literal text strings. Recently, the corresponding function has been integrated successfully into xdvik, cf.
"https://sourceforge.net/tracker/index.php?func=detail&aid=1530667&group_id=23164&atid=377580".

When using scan_ps_literal_text_string() for kdvi, one should easily get rid of the reported bug. Please consider the attached source code.
Comment 6 Matthias Habl 2006-08-01 23:39:53 UTC
Created attachment 17196 [details]
C function
Comment 7 Matthias Habl 2006-08-01 23:42:04 UTC
Comment on attachment 17196 [details]
C function

a function for parsing URLs in DVI files according to PostScript specification
Comment 8 Stefan Kebekus 2006-08-08 18:18:06 UTC
Dear Mr. Habl,

thank you very much for the help ---and please apologize the long silence. With your help I have fixed the issue now. The bugfix will be contained in the upcoming KDE 3.5.5 release.

Again, thank you very much, and keep sending in problems even though I might be slow to answer. If you'd like to help with the future development, let me know.

Best,

Stefan.
Comment 9 Matthias Habl 2006-08-08 20:55:54 UTC
Dear Stefan,

thank you very much for considering the bug report. Looking at special.cpp, I found a point which might be still enhanced. Up to now, it seems that the algorithm also counts escaped parentheses, i.e. \( and \). So it will fail when the link contains unbalanced escaped parentheses. 

Matthias.
Comment 10 Matthias Habl 2006-09-09 12:45:44 UTC
Created attachment 17678 [details]
LaTeX

A new version with unbalanced escaped parentheses.
Comment 11 Matthias Habl 2006-09-09 12:47:13 UTC
Created attachment 17679 [details]
DVI

A new version with unbalanced escaped parentheses.
Comment 12 Matthias Habl 2006-09-09 12:48:20 UTC
Created attachment 17680 [details]
PDF

A new version with unbalanced escaped parentheses.
Comment 13 Stefan Kebekus 2006-11-04 09:27:57 UTC
Dear Matthias,

thanks for the additional comments. I have updated the code now; the 
unbalanced escaped parentheses from your example no longer cause problems. 
Thank you for going into this!

Best,

Stefan.
Comment 14 Jekyll Wu 2013-09-28 13:42:30 UTC
kdvi is no longer maintained since KDE SC 4, and its functionality is replace by okular.  If the issue in this report still exists in or apply to okular in KDE SC 4.10.5 or higher, please reassign the report to okular product or create a new report against okular.