[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] Issues with -dont_wrap_pre and -nomargins

From: Claus Strommer
Subject: Re: [Lynx-dev] Issues with -dont_wrap_pre and -nomargins
Date: Tue, 6 Oct 2009 15:58:49 -0400

It seems that I spoke too soon. Further reviews of the output reveal that there are still instances of missing whitespace. I can reduce the number of hits by increasing the --width option, and am trying to cook together something to pad the 'splits' with a whitespace (since i don't have to worry about terminal width).

On a different note: I am trying to eliminate image links and image alt-text altogether from my output:

For the former I've tried using the --image_links- option. Alas, I see no change. If I explicitly enable image links via the -- image_links option I actually get TWO [image.jpg] links in the dump output; I don't know if that is a bug or there by design.

I have not found an option to exclude alt-text; I assume that it is not built in, and don't expect a toggle to be added for it any time soon. I would only ask if anyone familiar with the code could point me to the appropriate file where I could perhaps disable the output generated for images (or replace it with an empty string).

On 2009-09-16, at 11:53 AM, Claus Strommer wrote:

Just a quick followup:

Changing the definitions in LYOptions.c does not affect the output.
However, changing lines 469 and 485 in DefaultStyle.c from
                q->rightIndent = 0;
                q->rightIndent = 1;

does the trick.

Thanks for the help!

On 2009-09-16, at 4:59 AM, Thomas Dickey wrote:


So my question is: Is there anything I can do to work around this? I would

...other than fixing the bug - perhaps not. (I'm working on xterm and mawk at the moment, intending to go back to lynx next...).

Just reading the code: It looks as if -nomargins goes to the no_margins variable, and _that_ is used in only a few places:

DefaultStyle.c:466:         if (no_margins) {
DefaultStyle.c:482:         if (no_margins) {
LYGlobalDefs.h:394:    extern BOOLEAN no_margins;
LYMain.c:393:BOOLEAN no_margins = FALSE;
LYMain.c:3622: "nomargins", 4|SET_ARG, no_margins,
LYOptions.c:35:#define MARGIN_STR (no_margins ? "" : "&nbsp;&nbsp;")
LYOptions.c:36:#define MARGIN_LEN (no_margins ?  0 : 2)
LYrcFile.h:159:#define RC_NO_MARGINS                   "no_margins"
LYReadCFG.c:1494:     PARSE_SET(RC_NO_MARGINS,           no_margins),

The uses in DefaultStyle.c and LYOptions.c are simple to change and see if the bug's behavior changes predictably. For instance, making -no_margins do a single character rather than none might make it usable for your script.

The derived variables are used in GridText.c's split_line() function, which is (complicated) where the boundary check is most likely off.
It's complicated, since there are long expressions such as

      spare = WRAP_COLS(text)
          - (int) style->rightIndent
          - indent
          + ctrl_chars_on_previous_line
          - LYstrExtent2(previous->data, previous->size);

But that's the area where the fix would probably be made - split_line.

very much like to keep using these two options, as it is important to me to be able to distinguish between lines and paragraphs. I am even willing to use other tools, if you can suggest any - but as far as I've seen, lynx is the only one which gives the desired options. Also, I'd like to stay away from the -width option (it does not allow me to specify infinite width, AND it breaks with tables - the attached b.html, for example).

Thomas E. Dickey

Claus W. Strommer
University of Waterloo, David R. Cheriton School of Computer Science

ruby -le'32.times{|y|print" "*(31-y),(0..y).map{|x|~y&x>0?" .":" A"}}'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]