Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post.url is unsafe for long strings #27

Open
rhaberkorn opened this issue Jan 14, 2023 · 4 comments
Open

post.url is unsafe for long strings #27

rhaberkorn opened this issue Jan 14, 2023 · 4 comments

Comments

@rhaberkorn
Copy link

post.url cannot handle links that span across multiple lines as it assumes that the link text fits into a plain rectangle.
For instance:

\*[post.url 1 "sdfklsdflksdfjsdfkljsdflk dfgkgkldfgjdflgjdflkgjdfglkjdfglkjsaf sdfsdfkljsdfklg sdfsdfjksdfj sdfsdfhjsdhfjsdf sdfsdfsdfhjsdfhj"]

Build with:

roff -mpost -ms url-bug.ms | pdf >url-bug.pdf

That's enough to reproduce the "bug". Effectively, links are only safe on single non-breakable words or at the beginning of a line.

Is there a way to fix that? I see that ms .BX macro behaves similarly.

@aligrudi
Copy link
Owner

aligrudi commented Jan 14, 2023 via email

@rhaberkorn
Copy link
Author

rhaberkorn commented Jan 15, 2023

Groff/MOM somehow does it right:

.PRINTSTYLE TYPESET
.START
.PP
.PDF_WWW_LINK http://www.google.de "dfjsdf sdf sdfksdjfdslkf fdsfksldfjsd lfsldflsdkf  dsfksldfjdsflds  sd fsdf sdf sdf dsfs df kljsdflkjdsflksdjf sdf"

Actually, I wanted to use Heirloom and/or Neatroff to get away from Groff/mom. But the deeper I dive into it, the more basic features I find missing or broken. Mom really does something for its money, although it needs 23500 lines of hard to maintain code to achieve that and has plenty of bugs as well. Let's face it, Troff in reality sucks at least for complex scientific documents. The language is too low level, putting too much burden on the macro package to get things right.

@aligrudi
Copy link
Owner

aligrudi commented Jan 15, 2023 via email

@rhaberkorn
Copy link
Author

I personally think macro packages in Troff are much simpler and more readable than Tex's

I have no serious experience with Tex, but yes, usually they are easy to hack. The 1970s macro packages like ms however are hard to understand in their entirety because they are restricted to two-letter names and are largely uncommented.
Newer macro packages like Utroff lack support for most of the classic preprocessors, though and I am reluctant on trying my hand at implementing them myself.
Even if I disable links for the time being, I'd have a bunch of other glitches in ms. For instance when using floats (for figures and the like), you can easily end up with a footnote appearing before its reference in the text. Debugging that will probably take me days. I had the unfounded expectation that the 1970s stuff should be rock solid by now. Turns out, it isn't at all. Perhaps I will give the Plan9 mm and me a try as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants