Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.misc > #17668 > unrolled thread

What's Wrong With Newlines?

Started byComputer Nerd Kev <not@telling.you.invalid>
First post2019-03-29 01:59 +0000
Last post2019-04-01 16:10 +0000
Articles 18 — 10 participants

Back to article view | Back to comp.misc


Contents

  What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-03-29 01:59 +0000
    Re: What's Wrong With Newlines? Dan Espen <dan1espen@gmail.com> - 2019-03-28 23:31 -0400
      Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 23:22 +0000
        Re: What's Wrong With Newlines? Mike Spencer <mds@bogus.nodomain.nowhere> - 2019-03-29 21:58 -0300
          Re: What's Wrong With Newlines? Huge <Huge@nowhere.much.invalid> - 2019-03-30 11:23 +0000
          Re: What's Wrong With Newlines? RS Wood <rsw@therandymon.com> - 2019-03-30 09:02 -0400
          Re: What's Wrong With Newlines? Kees Nuyt <k.nuyt@nospam.demon.nl> - 2019-03-30 15:24 +0100
    Re: What's Wrong With Newlines? Huge <Huge@nowhere.much.invalid> - 2019-03-29 09:32 +0000
      Re: What's Wrong With Newlines? Bob Eager <news0073@eager.cx> - 2019-03-29 09:44 +0000
        Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 23:07 +0000
    Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-29 21:26 +0000
      Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 22:56 +0000
        Re: What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-03-30 00:21 +0000
          Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-30 14:37 +0000
            Re: What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-04-17 07:04 +0000
              Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-04-17 12:23 +0000
        Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-30 14:33 +0000
      Re: What's Wrong With Newlines? scott@alfter.diespammersdie.us (Scott Alfter) - 2019-04-01 16:10 +0000

#17668 — What's Wrong With Newlines?

FromComputer Nerd Kev <not@telling.you.invalid>
Date2019-03-29 01:59 +0000
SubjectWhat's Wrong With Newlines?
Message-ID<q7ju57$pl4$1@gioia.aioe.org>
Increasingly web forms for sending general messages to people
(usually in place of Email) seem to deliberately reject all the
newlines that I attempt to put into them. It seems to be deliberate,
or at least not considered worth fixing, which is strange because I
would consider it a major issue.

Usually they allow you to enter the newlines in the actual textarea
box, but then when you send it and look back, all the formatting is
reduced to a mess, often with joined-together words. I seem to
usually want to include a list of something, or postal address, in
these posts and the newline stripping completely obliterates any
attempt to make them readable.

One site that I used recently actually sent the message as soon as I
pressed Enter, so the recipient got an Email from me saying only
"Hello,".

Why? What's wrong with newlines? The web seemed to exist in harmony
with them for so long!

Now I have to keep going through messages after writing them and
putting two or three spaces at the ends of each newline, just to
ensure some sort of visible break and prevent things from getting
joined together. An add-on to do this automatically would be really
handy actually, but there doesn't seem to be one for Firefox that I
can find.

-- 
__          __
#_ < |\| |< _#

[toc] | [next] | [standalone]


#17673

FromDan Espen <dan1espen@gmail.com>
Date2019-03-28 23:31 -0400
Message-ID<q7k3in$av$1@dont-email.me>
In reply to#17668
Computer Nerd Kev <not@telling.you.invalid> writes:

> Increasingly web forms for sending general messages to people
> (usually in place of Email) seem to deliberately reject all the
> newlines that I attempt to put into them. It seems to be deliberate,
> or at least not considered worth fixing, which is strange because I
> would consider it a major issue.
>
> Usually they allow you to enter the newlines in the actual textarea
> box, but then when you send it and look back, all the formatting is
> reduced to a mess, often with joined-together words. I seem to
> usually want to include a list of something, or postal address, in
> these posts and the newline stripping completely obliterates any
> attempt to make them readable.
>
> One site that I used recently actually sent the message as soon as I
> pressed Enter, so the recipient got an Email from me saying only
> "Hello,".
>
> Why? What's wrong with newlines? The web seemed to exist in harmony
> with them for so long!
>
> Now I have to keep going through messages after writing them and
> putting two or three spaces at the ends of each newline, just to
> ensure some sort of visible break and prevent things from getting
> joined together. An add-on to do this automatically would be really
> handy actually, but there doesn't seem to be one for Firefox that I
> can find.

Notice your keyboard lacks a Return (Newline) key.
Most keyboards label the key Enter.

In the old days, (IBM 3270 terminals) had a Newline key AND
an Enter key.  They did quite different things,
one was for navigating the screen, the other sent the data
to the host.

So, only one key, the web form designer has to decide,
does this Enter key do formatting or message sending.
It can't easily do both.

I've mis-typed Enter in chat type apps more than once.
Bugs me too.

-- 
Dan Espen

[toc] | [prev] | [next] | [standalone]


#17693

Fromnot@telling.you.invalid (Computer Nerd Kev)
Date2019-03-29 23:22 +0000
Message-ID<q7m9c2$1cvg$1@gioia.aioe.org>
In reply to#17673
Dan Espen <dan1espen@gmail.com> wrote:
> 
> Notice your keyboard lacks a Return (Newline) key.
> Most keyboards label the key Enter.
> 
> In the old days, (IBM 3270 terminals) had a Newline key AND
> an Enter key.  They did quite different things,
> one was for navigating the screen, the other sent the data
> to the host.
> 
> So, only one key, the web form designer has to decide,
> does this Enter key do formatting or message sending.
> It can't easily do both.

Personally I'd rather they left such decisions up to the user's web
browser, which could be configured to the user's preference. My
preference is that clicking in a textarea box should disable all
browser/script shortcuts until the box is deselected.

Though the Return of a special key for the job would be even better.

-- 
__          __
#_ < |\| |< _#

[toc] | [prev] | [next] | [standalone]


#17695

FromMike Spencer <mds@bogus.nodomain.nowhere>
Date2019-03-29 21:58 -0300
Message-ID<87ef6pfaah.fsf@bogus.nodomain.nowhere>
In reply to#17693
not@telling.you.invalid (Computer Nerd Kev) writes:

> Personally I'd rather they left such decisions up to the user's web
> browser, which could be configured to the user's preference. 

The horror!  The horror!  This is not 1993!  Web pages are supposed to
look and behave the way the marketing droids say they should; in the
absence of a marketing department, the way PFY "web designers" and
30-something "UX engineers" say they should.

Now I will go wash my mouth^H^H^H^H^H keyboard with lye soap.

-- 
Mike Spencer                  Nova Scotia, Canada

[toc] | [prev] | [next] | [standalone]


#17703

FromHuge <Huge@nowhere.much.invalid>
Date2019-03-30 11:23 +0000
Message-ID<gg91thFr73uU1@mid.individual.net>
In reply to#17695
On 2019-03-30, Mike Spencer <mds@bogus.nodomain.nowhere> wrote:
>
> not@telling.you.invalid (Computer Nerd Kev) writes:
>
>> Personally I'd rather they left such decisions up to the user's web
>> browser, which could be configured to the user's preference. 
>
> The horror!  The horror!  This is not 1993!  Web pages are supposed to
> look and behave the way the marketing droids say they should; in the
> absence of a marketing department, the way PFY "web designers" and
> 30-something "UX engineers" say they should.

*applause*


-- 
Today is Prickle-Prickle, the 16th day of Discord in the YOLD 3185
1. What power do you have?  2. Where did you get it?  3. In whose
interests do you exercise it?  4. To whom are you accountable?  5. How
                  can we get rid of you?

[toc] | [prev] | [next] | [standalone]


#17705

FromRS Wood <rsw@therandymon.com>
Date2019-03-30 09:02 -0400
Message-ID<kv54nf-8ke.ln1@rasp.therandymon.com>
In reply to#17695
On 2019-03-30, Mike Spencer <mds@bogus.nodomain.nowhere> wrote:
>
> not@telling.you.invalid (Computer Nerd Kev) writes:
>
>> Personally I'd rather they left such decisions up to the user's web
>> browser, which could be configured to the user's preference. 
>
> The horror!  The horror!  This is not 1993!  Web pages are supposed to
> look and behave the way the marketing droids say they should; in the
> absence of a marketing department, the way PFY "web designers" and
> 30-something "UX engineers" say they should.
>
> Now I will go wash my mouth^H^H^H^H^H keyboard with lye soap.

Don't forget to flagellate yourself a couple times with a horsewhip, for
the blasphemy. ;)

Boo on UX "experts."  Boo.

[toc] | [prev] | [next] | [standalone]


#17706

FromKees Nuyt <k.nuyt@nospam.demon.nl>
Date2019-03-30 15:24 +0100
Message-ID<sruu9etb71bge4nc1fni2hhtalfhc961ph@dim53.demon.nl>
In reply to#17695
On 29 Mar 2019 21:58:14 -0300, Mike Spencer
<mds@bogus.nodomain.nowhere> wrote:

>
>not@telling.you.invalid (Computer Nerd Kev) writes:
>
>> Personally I'd rather they left such decisions up to the user's web
>> browser, which could be configured to the user's preference. 
>
> The horror!  The horror!  This is not 1993!  Web pages are supposed to
> look and behave the way the marketing droids say they should; in the
> absence of a marketing department, the way PFY "web designers" and
> 30-something "UX engineers" say they should.

Yeah, tiny sans-serif light-gray text on a white background.
Sigh.


> Now I will go wash my mouth^H^H^H^H^H keyboard with lye soap.
-- 
Kees Nuyt

[toc] | [prev] | [next] | [standalone]


#17679

FromHuge <Huge@nowhere.much.invalid>
Date2019-03-29 09:32 +0000
Message-ID<gg670lF7seuU5@mid.individual.net>
In reply to#17668
On 2019-03-29, Computer Nerd Kev <not@telling.you.invalid> wrote:
> Increasingly web forms for sending general messages to people
> (usually in place of Email) seem to deliberately reject all the
> newlines that I attempt to put into them. It seems to be deliberate,
> or at least not considered worth fixing, which is strange because I
> would consider it a major issue.

What do you mean by "newlines"? Have you tried "Enter", "Shift-Enter"
or CTRL-J to see if there's any difference?


-- 
Today is Pungenday, the 15th day of Discord in the YOLD 3185
1. What power do you have?  2. Where did you get it?  3. In whose
interests do you exercise it?  4. To whom are you accountable?  5. How
                  can we get rid of you?

[toc] | [prev] | [next] | [standalone]


#17680

FromBob Eager <news0073@eager.cx>
Date2019-03-29 09:44 +0000
Message-ID<gg67o4FhfuU3@mid.individual.net>
In reply to#17679
On Fri, 29 Mar 2019 09:32:05 +0000, Huge wrote:

> On 2019-03-29, Computer Nerd Kev <not@telling.you.invalid> wrote:
>> Increasingly web forms for sending general messages to people (usually
>> in place of Email) seem to deliberately reject all the newlines that I
>> attempt to put into them. It seems to be deliberate,
>> or at least not considered worth fixing, which is strange because I
>> would consider it a major issue.
> 
> What do you mean by "newlines"? Have you tried "Enter", "Shift-Enter"
> or CTRL-J to see if there's any difference?

I often find that Ctrl-Enter (which is usually interpreted as Ctrl-J, or 
ASCII LF) works.



-- 
Using UNIX since v6 (1975)...

Use the BIG mirror service in the UK:
 http://www.mirrorservice.org

[toc] | [prev] | [next] | [standalone]


#17692

Fromnot@telling.you.invalid (Computer Nerd Kev)
Date2019-03-29 23:07 +0000
Message-ID<q7m8g2$18sj$1@gioia.aioe.org>
In reply to#17680
Bob Eager <news0073@eager.cx> wrote:
> On Fri, 29 Mar 2019 09:32:05 +0000, Huge wrote:
> 
>> On 2019-03-29, Computer Nerd Kev <not@telling.you.invalid> wrote:
>>> Increasingly web forms for sending general messages to people (usually
>>> in place of Email) seem to deliberately reject all the newlines that I
>>> attempt to put into them. It seems to be deliberate,
>>> or at least not considered worth fixing, which is strange because I
>>> would consider it a major issue.
>> 
>> What do you mean by "newlines"? Have you tried "Enter", "Shift-Enter"
>> or CTRL-J to see if there's any difference?
> 
> I often find that Ctrl-Enter (which is usually interpreted as Ctrl-J, or 
> ASCII LF) works.

Thanks, I've just been using "Enter" so far, except I have used
"Shift-Enter" in the past for pages that use Javascript to mess with
the newlines as you type. To be honest, I'd forgotten about that
trick.

I'll give those a go next time, though of course it's a bit hard if
the page doesn't show you the result until after the message is sent.

-- 
__          __
#_ < |\| |< _#

[toc] | [prev] | [next] | [standalone]


#17689

FromRich <rich@example.invalid>
Date2019-03-29 21:26 +0000
Message-ID<q7m2hj$re7$4@dont-email.me>
In reply to#17668
Computer Nerd Kev <not@telling.you.invalid> wrote:
> Increasingly web forms for sending general messages to people 
> (usually in place of Email) seem to deliberately reject all the 
> newlines that I attempt to put into them.  It seems to be deliberate, 

It is deliberate.

The html textarea form field submits the line ending characters you 
type into the box to the server when the web form is posted.

So if the line break characters disappear when you submit, it means the 
programmers are stripping them out somewhere (either locally with 
javascript as part of the submission, or on the server side after the 
data from the text area is sent over there).

If it happens to be a local, javascript based stripping, you might be 
able to inject new JS into the page that replaces their submit function 
with a new one that does not strip.  But digging through the js to find 
what to do will be quite a lot of effort.

[toc] | [prev] | [next] | [standalone]


#17691

Fromnot@telling.you.invalid (Computer Nerd Kev)
Date2019-03-29 22:56 +0000
Message-ID<q7m7rm$15hq$1@gioia.aioe.org>
In reply to#17689
Rich <rich@example.invalid> wrote:
> Computer Nerd Kev <not@telling.you.invalid> wrote:
>> Increasingly web forms for sending general messages to people 
>> (usually in place of Email) seem to deliberately reject all the 
>> newlines that I attempt to put into them.  It seems to be deliberate, 
> 
> It is deliberate.
> 
> The html textarea form field submits the line ending characters you 
> type into the box to the server when the web form is posted.

Yes, I've never had any problem with disappearing newlines from
textareas when designing pages myself, nor would I expect one.

> So if the line break characters disappear when you submit, it means the 
> programmers are stripping them out somewhere (either locally with 
> javascript as part of the submission, or on the server side after the 
> data from the text area is sent over there).

My uncertainty was over whether there might be some standard function
or method of handling a web form, which when abused in a certain way
results in this behaviour. The designers, being incompetent, either
don't test it enough to notice, or don't know enough about whatever
language they're working in to fix it.

Seems a pretty sad state of affairs, but it seems a pretty insane
state of affairs to deliberately strip out newlines. It seems too
widespread to be either extreme insanity or extreme imcompetance, so
I'm confused.

> If it happens to be a local, javascript based stripping, you might be 
> able to inject new JS into the page that replaces their submit function 
> with a new one that does not strip.  But digging through the js to find 
> what to do will be quite a lot of effort.

Yes, and many times the text displays fine when composing, with the
lack of newlines only seen when later viewing the sent message, or
sometimes only when a reply is received with your message quoted
in it (having been sent to the recipient as an Email by the website).
So this implies that the strpping happens server-side, though
anything is possible.

Even when a script does display the stripped text before sending, I
often only want to use these forms once, or very infrequently. In
fact the ones that I do use frequently work as above.

And I don't know Javascript anyway.

-- 
__          __
#_ < |\| |< _#

[toc] | [prev] | [next] | [standalone]


#17694

FromComputer Nerd Kev <not@telling.you.invalid>
Date2019-03-30 00:21 +0000
Message-ID<q7mcpb$1riu$1@gioia.aioe.org>
In reply to#17691
Computer Nerd Kev <not@telling.you.invalid> wrote:
> Rich <rich@example.invalid> wrote:
>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>> Increasingly web forms for sending general messages to people 
>>> (usually in place of Email) seem to deliberately reject all the 
>>> newlines that I attempt to put into them.  It seems to be deliberate, 
>> 
>> It is deliberate.
>> 
>> The html textarea form field submits the line ending characters you 
>> type into the box to the server when the web form is posted.
> 
> Yes, I've never had any problem with disappearing newlines from
> textareas when designing pages myself, nor would I expect one.

Of course to put it into HTML the newlines have to be replaced with
paragraphs or line breaks. Easily done with functions like nl2br in
PHP though, and surely within the means of any developer for a major
website.

-- 
__          __
#_ < |\| |< _#

[toc] | [prev] | [next] | [standalone]


#17708

FromRich <rich@example.invalid>
Date2019-03-30 14:37 +0000
Message-ID<q7nuv9$82v$2@dont-email.me>
In reply to#17694
Computer Nerd Kev <not@telling.you.invalid> wrote:
> Computer Nerd Kev <not@telling.you.invalid> wrote:
>> Rich <rich@example.invalid> wrote:
>>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>>> Increasingly web forms for sending general messages to people 
>>>> (usually in place of Email) seem to deliberately reject all the 
>>>> newlines that I attempt to put into them.  It seems to be deliberate, 
>>> 
>>> It is deliberate.
>>> 
>>> The html textarea form field submits the line ending characters you 
>>> type into the box to the server when the web form is posted.
>> 
>> Yes, I've never had any problem with disappearing newlines from
>> textareas when designing pages myself, nor would I expect one.
> 
> Of course to put it into HTML the newlines have to be replaced with
> paragraphs or line breaks. Easily done with functions like nl2br in
> PHP though, and surely within the means of any developer for a major
> website.

Hmm, that is also a very likely cause.  HTML ignores ASCII \n 
characters (treating them as nothing more than spaces).  If the message 
is being displayed in a web page somewhere, the programmer has to 
explicitly translate \n characters from the textarea into <br> or <p> 
tags in the resulting HTML.

If they just insert the raw contents of the message box into a <p>
(or more likely a <div>) wrapper, you end up with this effect.

What happens if you insert <br> or <p> into the text area when you are 
sending the messages?  Note that if those work to produce line breaks 
on the other end, then it also means you can insert <script> tags to 
make their browsers do anything you want.

[toc] | [prev] | [next] | [standalone]


#17834

FromComputer Nerd Kev <not@telling.you.invalid>
Date2019-04-17 07:04 +0000
Message-ID<q96j56$1qia$1@gioia.aioe.org>
In reply to#17708
Rich <rich@example.invalid> wrote:
> Computer Nerd Kev <not@telling.you.invalid> wrote:
>> 
>> Of course to put it into HTML the newlines have to be replaced with
>> paragraphs or line breaks. Easily done with functions like nl2br in
>> PHP though, and surely within the means of any developer for a major
>> website.
> 
> Hmm, that is also a very likely cause.  HTML ignores ASCII \n 
> characters (treating them as nothing more than spaces).  If the message 
> is being displayed in a web page somewhere, the programmer has to 
> explicitly translate \n characters from the textarea into <br> or <p> 
> tags in the resulting HTML.
> 
> If they just insert the raw contents of the message box into a <p>
> (or more likely a <div>) wrapper, you end up with this effect.
>
> What happens if you insert <br> or <p> into the text area when you are 
> sending the messages?  Note that if those work to produce line breaks 
> on the other end, then it also means you can insert <script> tags to 
> make their browsers do anything you want.

I finally found cause to use one that allows you to preview the text
before sending. Indeed the newlines, in whatever form I enter them,
are copied straight into the HTML, inside a <div>. Manually added
<br>s and <p>s were stripped out, which is really a good thing.

So they simply haven't cared to use a function which replaces
newlines with <br> or <p>. Just lazyness or a lack of testing I
guess, though it seems strange given that these are often very
major websites.

-- 
__          __
#_ < |\| |< _#

[toc] | [prev] | [next] | [standalone]


#17836

FromRich <rich@example.invalid>
Date2019-04-17 12:23 +0000
Message-ID<q975sc$4t6$1@dont-email.me>
In reply to#17834
Computer Nerd Kev <not@telling.you.invalid> wrote:
> Rich <rich@example.invalid> wrote:
>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>> 
>>> Of course to put it into HTML the newlines have to be replaced with
>>> paragraphs or line breaks. Easily done with functions like nl2br in
>>> PHP though, and surely within the means of any developer for a major
>>> website.
>> 
>> Hmm, that is also a very likely cause.  HTML ignores ASCII \n 
>> characters (treating them as nothing more than spaces).  If the message 
>> is being displayed in a web page somewhere, the programmer has to 
>> explicitly translate \n characters from the textarea into <br> or <p> 
>> tags in the resulting HTML.
>> 
>> If they just insert the raw contents of the message box into a <p>
>> (or more likely a <div>) wrapper, you end up with this effect.
> 
> I finally found cause to use one that allows you to preview the text
> before sending. Indeed the newlines, in whatever form I enter them,
> are copied straight into the HTML, inside a <div>. Manually added
> <br>s and <p>s were stripped out, which is really a good thing.
> 
> So they simply haven't cared to use a function which replaces
> newlines with <br> or <p>.

> Just lazyness 

This is likely the root cause - or at the very least not even 
considering the possibility that someone might try to enter line 
breaks.

> or a lack of testing

This is, of course, how it was never found and went out to the world.  
Most 'testers' in this context are not very creative, and often they 
just type something like "the quick brown fox jumped over the lazy dog" 
and if that ends up in the 'message', they declare pass on their tests.

But it never occurs to them to try some line breaks, or some 
punctuation (esp. punctuation that is html or sql specific) or other 
stuff, which is how so many XSS and sql injection openings get exposed 
to the world. 

> I guess, though it seems strange given that these are often very 
> major websites.

Nothing strange there.  That just confirms that their 'test folks' are 
likely more of the 'head count' variety (in order to check a box on a 
compliance form that there are testers) than the testers are real, 
good, testers that find the edge conditions.

[toc] | [prev] | [next] | [standalone]


#17707

FromRich <rich@example.invalid>
Date2019-03-30 14:33 +0000
Message-ID<q7nuoj$82v$1@dont-email.me>
In reply to#17691
Computer Nerd Kev <not@telling.you.invalid> wrote:
> Rich <rich@example.invalid> wrote:
>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>> Increasingly web forms for sending general messages to people 
>>> (usually in place of Email) seem to deliberately reject all the 
>>> newlines that I attempt to put into them.  It seems to be deliberate, 
>> 
>> It is deliberate.
>> 
>> The html textarea form field submits the line ending characters you 
>> type into the box to the server when the web form is posted.
> 
> Yes, I've never had any problem with disappearing newlines from
> textareas when designing pages myself, nor would I expect one.
> 
>> So if the line break characters disappear when you submit, it means the 
>> programmers are stripping them out somewhere (either locally with 
>> javascript as part of the submission, or on the server side after the 
>> data from the text area is sent over there).
> 
> My uncertainty was over whether there might be some standard function
> or method of handling a web form, which when abused in a certain way
> results in this behaviour.

I'm not aware of any bog-standard way to obtain the contents of a text 
area sans line ending characters.

However, it may be possible that "web framework du-jour of the month" 
that these developers utilized comes with a JS function that performs 
a: "get text area contents, strip newlines".

It is also possible that what you are seeing is an unintended 
consequence of an over-zealous "character sanitizer" trying to prevent 
cross site scripting exploits (and doing it wrong, by the way).  If the 
filter is "strip out all but [A-Za-z0-9,.] or something like that, then 
you get line ending characters being stripped out needlessly, simply 
because the developer didn't think through the ramifications of their 
sanitizer filter.

[toc] | [prev] | [next] | [standalone]


#17717

Fromscott@alfter.diespammersdie.us (Scott Alfter)
Date2019-04-01 16:10 +0000
Message-ID<q7td5v$ni1$1@dont-email.me>
In reply to#17689
In article <q7m2hj$re7$4@dont-email.me>, Rich  <rich@example.invalid> wrote:
>Computer Nerd Kev <not@telling.you.invalid> wrote:
>> Increasingly web forms for sending general messages to people 
>> (usually in place of Email) seem to deliberately reject all the 
>> newlines that I attempt to put into them.  It seems to be deliberate, 
>
>It is deliberate.
>
>The html textarea form field submits the line ending characters you 
>type into the box to the server when the web form is posted.
>
>So if the line break characters disappear when you submit, it means the 
>programmers are stripping them out somewhere (either locally with 
>javascript as part of the submission, or on the server side after the 
>data from the text area is sent over there).

It's also possible that they're still there, but if the text you entered is
included in a webpage without any preprocessing, the newlines will appear to
be ignored because HTML regards them as whitespace unless the text is within
a <pre> block.  If they're neglecting to do any filtering or formatting of
user-provided text at all, though, lack of proper newline handling is the
least of your problems, as they've introduced security holes big enough that
you could drive a truck through them.

  _/_
 / v \ Scott Alfter (remove the obvious to send mail)
(IIGS( https://alfter.us/           Top-posting!
 \_^_/                              >What's the most annoying thing on Usenet?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.misc


csiph-web