Re: Newline and tab characters



Browsers ignore \n \r and \t. Look at the resultant html source code in your browser.

Something is converting them BEFORE sending the html code to the client browser.

Arno Kuhl wrote:
I've just noticed that "\r\n" and "\t" characters create a space when
rendered in the browser (tested in IE and Firefox). I'd always thought the
browser would ignore these characters. This wouldn't normally be a problem
but the wysiwyg html editor in the cms I'm using tries to be friendly by
formatting the html code, so something like

<span style=\"COLOR: #af0e14\">get</span><span style=\"COLOR:
#333333\">online</span>

becomes

\r\n\t\t<span style=\"COLOR: #af0e14\">get</span>\r\n\t\t<span
style=\"COLOR: #333333\">online</span>

and instead of being displayed as getonline it's displayed as get online.

Is there a simple way to sort this out or do I need to create a function to
strip these characters before display, checking first that they don't occur
within a <pre> tag in which case I mustn't strip them.

TIA
Arno
.



Relevant Pages

  • Re: intranet page not viewable
    ... The page is basic HTML code. ... > Security setting to low but the page still does not display. ... When I point my browser to the local HTML file the page will ...
    (microsoft.public.windows.inetexplorer.ie6.ieak)
  • Re: Hmmmm, strange ?
    ... It shows up nicely Centred in various different Browser Window Sizes ... The HTML Code that has been Generated by the combination of the ... each of the Links has a whole load of extra Tags ...
    (uk.people.silversurfers)
  • Re: Outlook Express prints all messages in HTML code.
    ... It seems his in house tech guy suggested that he set his browser with Google ... MS-MVP Outlook Express ... The real problem is the messages can only be printed in HTML code. ... there are no .TMP files on the list. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: formatting in a text box
    ... > different browser is used. ... It's on the drawing tool bar. ... View the page in HTML code mode? ... Use an HTML validator. ...
    (microsoft.public.frontpage.programming)
  • Re: Displaying the html from a ruby .cgi script
    ... I can load it into my browser, ... Is there an easy way to grab that generated html code and ... display it on a console? ...
    (comp.lang.ruby)