Bug 33913

Summary: GNATS webinterface isn't wrapping lines
Product: Documentation Reporter: tedm <tedm>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description tedm 2002-01-15 07:20:00 UTC
This URL http://www.freebsd.org/send-pr.html is not wrapping lines when you type in a PR description in the window and you just let the window wrap the cursor, it makes them hard to read, arggggg!!
Comment 1 ru freebsd_committer freebsd_triage 2002-01-15 15:28:45 UTC
State Changed
From-To: open->closed

This is not a problem with interface, but rather with your 
client software (I guess that was IE or Mozilla?).  Both 
lynx(1) and links(1) I've tried as well correctly display 
line wrapping by hiding the beginning of the line and not 
automatically wrapping the rest to the next line.
Comment 2 tedm 2002-01-16 06:32:38 UTC
This is not a brower problem, it is because
the GNATS interface HTML has a coding error.

The relevant HTML on http://www.freebsd.org/send-pr.html SHOULD BE as follows:

 <textarea name="environment" rows="3" cols="72">
      </textarea><br>
       <b>Full Description</b>:<br>
       <textarea wrap="hard" name="description" rows="6" cols="72">
      </textarea><br>
       <b>How to repeat the problem</b>:<br>
       <textarea wrap="hard" name="howtorepeat" rows="6" cols="72">
      </textarea><br>
       <b>Fix to the problem if known</b>:<br>
       <textarea wrap="hard" name="fix" rows="6" cols="72">
      </textarea><br>
       <input type="SUBMIT" value="Submit Problem Report"> <input
      type="RESET" value="Reset">

Note the addition of the "wrap" directive.


Ted Mittelstaedt
Comment 3 mij 2002-01-16 07:55:45 UTC
On Tue, 15 Jan 2002 at 22:32:38 -0800, Ted Mittelstaedt wrote:
> This is not a brower problem, it is because
> the GNATS interface HTML has a coding error.
> 
> The relevant HTML on http://www.freebsd.org/send-pr.html SHOULD BE as follows:
> 
>  <textarea name="environment" rows="3" cols="72">
>       </textarea><br>
>        <b>Full Description</b>:<br>
>        <textarea wrap="hard" name="description" rows="6" cols="72">
>       </textarea><br>
>        <b>How to repeat the problem</b>:<br>
>        <textarea wrap="hard" name="howtorepeat" rows="6" cols="72">
>       </textarea><br>
>        <b>Fix to the problem if known</b>:<br>
>        <textarea wrap="hard" name="fix" rows="6" cols="72">
>       </textarea><br>
>        <input type="SUBMIT" value="Submit Problem Report"> <input
>       type="RESET" value="Reset">
> 
> Note the addition of the "wrap" directive.

The wrap attribute is not valid in HTML 4.01.

- jim

-- 
jim mock <mij@soupnazi.org>   http://soupnazi.org/ | jim@FreeBSD.org
Comment 4 tedm 2002-01-16 09:06:48 UTC
>-----Original Message-----
>From: Jim Mock [mailto:mij@soupnazi.org]
>Sent: Tuesday, January 15, 2002 11:56 PM
>To: Ted Mittelstaedt
>Cc: ru@FreeBSD.org; freebsd-doc@FreeBSD.org;
>freebsd-gnats-submit@FreeBSD.org
>Subject: Re: docs/33913: GNATS webinterface isn't wrapping lines
>
>>
>> Note the addition of the "wrap" directive.
>
>The wrap attribute is not valid in HTML 4.01.
>

It was not my intent to start a religious argument.  User input
code that doesen't massage the input is a coding error - what
happens if some joker decides to put in a javascript in a PR
that does something nasty?  Are we checking for that?

The wrap attribute was NEVER valid in any HTML spec.  It is and
remains a quick hack to get out of massaging user input.

Obviously the best way to solve this would be to further process
the user input on the webform to insert linebreaks in case someone
uses a browser that doesen't do what the code expects is "right"

But if nobody writes one then what's wrong with a quick hack?

The PR database already has a lot of these unwrapped entries with lines that
scroll off the side of the screen.  Which is more important - making PR's
readable or being "right"?

Ted
Comment 5 mij 2002-01-16 09:15:33 UTC
On Wed, 16 Jan 2002 at 01:06:48 -0800, Ted Mittelstaedt wrote:
> >-----Original Message-----
> >From: Jim Mock [mailto:mij@soupnazi.org]
> >Sent: Tuesday, January 15, 2002 11:56 PM
> >To: Ted Mittelstaedt
> >Cc: ru@FreeBSD.org; freebsd-doc@FreeBSD.org;
> >freebsd-gnats-submit@FreeBSD.org
> >Subject: Re: docs/33913: GNATS webinterface isn't wrapping lines
> >
> >>
> >> Note the addition of the "wrap" directive.
> >
> >The wrap attribute is not valid in HTML 4.01.
> >
> 
> It was not my intent to start a religious argument.  User input code
> that doesen't massage the input is a coding error - what happens if
> some joker decides to put in a javascript in a PR that does something
> nasty?  Are we checking for that?

You'd have to check dosendpr.cgi.

> The wrap attribute was NEVER valid in any HTML spec.  It is and
> remains a quick hack to get out of massaging user input.
> 
> Obviously the best way to solve this would be to further process the
> user input on the webform to insert linebreaks in case someone uses a
> browser that doesen't do what the code expects is "right"
> 
> But if nobody writes one then what's wrong with a quick hack?

What's wrong with it is that when the web site is built, the code is
validated, and if non-existant stuff is found, the build fails.  If we
add the wrap attribute, the build will fail because it isn't valid.

> The PR database already has a lot of these unwrapped entries with
> lines that scroll off the side of the screen.  Which is more important
> - making PR's readable or being "right"?

That's what horizontal scroll is for :-)  Seriously though, patches are
welcome to make things readable, but yes, it also must be "right" or
there will be problems with the build.

- jim

-- 
jim mock <mij@soupnazi.org>   http://soupnazi.org/ | jim@FreeBSD.org
Comment 6 tedm 2002-01-16 09:35:45 UTC
>-----Original Message-----
>From: Jim Mock [mailto:mij@soupnazi.org]
>Sent: Wednesday, January 16, 2002 1:16 AM
>To: Ted Mittelstaedt
>Cc: ru@FreeBSD.org; freebsd-doc@FreeBSD.org;
>freebsd-gnats-submit@FreeBSD.org
>Subject: Re: docs/33913: GNATS webinterface isn't wrapping lines
>
>
>That's what horizontal scroll is for :-)

Or I could always put the monitor on it's side...

>Seriously though, patches are
>welcome to make things readable, but yes, it also must be "right" or
>there will be problems with the build.

Then can we at least put a sentence on the entry page there
that says:

"Note: Lines entered are NOT automatically wrapped!"

preferably in between the "Full Description:" and the textbox,
the "How to repeat the problem: and the textbox, and the
"Fix to the problem if known: line and the textbox.

That, at least, might catch a few entries.

Ted
Comment 7 Murray Stokely freebsd_committer freebsd_triage 2002-01-17 05:39:22 UTC
On Wed, Jan 16, 2002 at 01:15:33AM -0800, Jim Mock wrote:
> > The wrap attribute was NEVER valid in any HTML spec.  It is and
> > remains a quick hack to get out of massaging user input.
> ...
> 
> What's wrong with it is that when the web site is built, the code is
> validated, and if non-existant stuff is found, the build fails.  If we
> add the wrap attribute, the build will fail because it isn't valid.


  I ran into this problem a lot over the last several weeks as I was
frantically trying to put up http://www.FreeBSDMall.com.

  Basically we're using the stock FreeBSD Web infrastructure with the
following small additions to web/share/mk/web.site.mk :

  * Addition of a 'spellcheck' target, so that we can check the
    formatted output for errors before committing changes.

  * Addition of a 'POSTPROCESS' target, so that invalid HTML can be
    specified with something like 

      "<body class='FreeBSDMall-bodystyle1'>" 

    A variable is set in the individual Makefiles to specify what
    replacement should be done.  In this case, the class attribute is
    replaced with the invalid but highly implemented margin
    attributes.

    web.site.mk then contains the Perl or sed command line to run the
    regexp specified in this variable over the generated HTML file.

  * Various other installation tweaks for our local.

The problem gets more complex for us, because we're using an
application server that embeds new invalid tags to the HTML.

We can use CDATA sections for some of this stuff, but that has the
side effect of changing < into &lt; and other problems that will
certainly confuse the application server.  If anyone is interested, I
can post the diffs for the above functionality, although it is really
quite trivial.

I would be very interested in hearing how other people deal with these
problems.  In particular, I know the POSTPROCESS stuff is a big ugly
hack, so I'd like to find a more SGML-friendly way to solve this problem.

	  - Murray