Re: how to prevent wrapping between "--" and "longoption" for html output?

2025-02-17 Thread Benno Schulenberg



In short, I would consider this to be a bug in the respective browsers.


Agreed.  A hyphen should only be considered a hyphenatable position
when it has _alphabetical_ characters on both sides.


Reported here:  https://bugzilla.mozilla.org/1948666


Benno



OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: how to prevent wrapping between "--" and "longoption" for html output?

2025-02-17 Thread Benno Schulenberg


Hi Branden,

Op 16-02-2025 om 15:13 schreef G. Branden Robinson:

Is there a way to mark such long
options in the man page so that browsers are prevented from breaking
the marked text in any way?


Yes.  It sounds like what you're looking for is the hyphenation control
escape sequence, `\%`.


I should have mentioned that I tried that, and that it doesn't work: it
changes nothing in the produced HTML code.  I had hoped that it would
produce either a  or a , with span.nobreak
defined as {white-space: nowrap}.


I think an HTML-only solution is undesirable because hyphenation can
occur with any groff output device, and the problem you're trying to
solve is general.


For nano, only the man page itself and the HTML version are relevant.
(The PDF is produced from the Texinfo file.)  The wrapping with `man`
is good, so I was looking to adjust only the HTML output.

Benno



OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: how to prevent wrapping between "--" and "longoption" for html output?

2025-02-17 Thread Benno Schulenberg


Hi onf,

Op 16-02-2025 om 16:55 schreef onf:

Sounds like "modern" web browsers just break lines poorly. I have
replicated what you are describing in Firefox 128.7.0esr.


I've checked that Dillo (3.0.5) does the same.  And epiphany (42.4)
too -- before it went into a tight spin and locked-up my laptop.


In short, I would consider this to be a bug in the respective browsers.


Agreed.  A hyphen should only be considered a hyphenatable position
when it has _alphabetical_ characters on both sides.  With anything
else, it is better to not hyphenate: it is better to not hyphenate
where it would be allowed, than to hyphenate where it is a problem.

I've looked through about:config ("hyphenat", "wrap"), but there
does not seem to be any knob to control this.


Benno



OpenPGP_signature.asc
Description: OpenPGP digital signature


how to prevent wrapping between "--" and "longoption" for html output?

2025-02-16 Thread Benno Schulenberg


Hi,

In the HTML version of a man page it can happen that a long option
(like --restricted) occurs near the right edge and that the browser
splits the thing into "--" at the end of the line and "restricted"
at the beginning of the next line.  Is there a way to mark such long
options in the man page so that browsers are prevented from breaking
the marked text in any way?

For example, in the man page of GNU nano [1], search for "--unix"
(without the quotes) and see that in the description of this option
and the next two options another long option is mentioned.  With
the default width of my browser, the description of the next option
(--view) gets wrapped like this:

  Just view the file and ... ... other files for viewing, unless --
  restricted is given too.

  [1] https://nano-editor.org/dist/v7/nano.1.html

This is undesirable.  So I've tried experimenting with:

  .de nobreak
  .  ie '\*[.T]'html' \\$1
  .  el \\$1
  ..

But that, of course, outputs  and  as text.  Is there
a way to tell groff to insert these things verbatim into the output,
as actual tags?


(I know that  is a deprecated tag, but it still works in Firefox.
That's good enough for me for now.)

[Please CC; not subscribed.]


Benno


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: how to prevent wrapping between "--" and "longoption" for html output?

2025-02-23 Thread Benno Schulenberg


Hello Branden,


Regarding the hyphenation problem, the lump in the carpet moves after
groff 1.22.4.  Because HTML output now produces − entities rather
than hyphens from *roff minus special characters (`\-`), [...]


Ouch!  I don't like the look of them on the HTML page: they are
"enormous", looking like ndashes.  And what's worse: when one
copy-pastes such an option (−−breaklonglines, for example) to
a terminal, nano thinks it is a file name.  Aarrr!  :(



...instead I can get...

yadda yadda yadda -
-restricted

...which I'm not sure is an improvement.


:)  No, that's not an improvement.



I think I have enough information to file a Savannah ticket, though I
can't promise I'll get to this specific problem before the groff 1.24.0
release, which is weeks overdue.  Would you like to be CCed by Savannah
on the ticket traffic?


Yes, please.


Regards,

Benno



OpenPGP_signature.asc
Description: OpenPGP digital signature