Failed replacement of space reference value inside HTML tags when viewed in a form textarea




16 years ago
5 years ago


(Reporter: mpn, Unassigned)



Firefox Tracking Flags

(Not tracked)




(1 attachment)



16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030827
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030827

When using a reference value for a space ( "&#032" ) and viewing inside a form
textarea, the reference value is not tranlated properly.  For example:

<br /> will be <br />

Note:  The reference space IS translated properly OUTSIDE of HTML tags

Reproducible: Always

Steps to Reproduce:
1. Go To The Example URL
2. Put Some HTML into The Text Area that contains spaces like XHTML style break
( fill in the title too )
3. Hit Submit and look at the textarea below the preview

Actual Results:  
<br /> will be <br />

Expected Results:  
<br /> should be <br />
I don't get this bug. It's a weird thing. I can't reproduce it in data: URI test 
cases. But anyway, nothing to do with the DOM.
Assignee: dom_bugs → parser
Component: DOM HTML → Parser

Comment 2

16 years ago
Yes, I was unsure if it was a DOM issue or not.  What would you classify this as
so I can reassign it, and who to reassign to?
Any chance of providing a testcase showing the problem?  That would help a lot...
Kiril: don't worry, I reasigned it (HTML: Parser).

bz: I tried making one for a while, but couldn't work out what the problem was.
Someone needs to take the page returned by the script at the URL, and minimise it.

Comment 5

16 years ago
Yes, the test URL would be the place to see it.

Keep the HTML simple as it will be stripped by the sanitizer if the tag is not

The HTML is generally a mess, glad to say the majority of it is not mine.  :)

Some additional details that might help.  Input is HTML sanitized, then control
returns, line feeds, tabs, spaces, and ' ' ( in that order ) are converted to
reference values to retain formatting when the content is brought back into the
textarea for editing and for easy formatting replacements on HTML output.

To fix the problem I dumped the space conversion to reference value and so far
it seems to have no affect on formatting.  This can be seen on

The output you would be interested in is around line 203 of the source output.  

<TEXTAREA class="textbox" wrap="virtual" cols="70" rows="18"
hixie, you removed the url from the URL field when you reassigned.  Hence my
question in comment 3.

The problem, as usual, is sticking of unescaped tags in the <textarea>.  Just
escaping the '<' at the beginning of the tag name fixed this bug.

This is a duplicate of the other issues with unescaped tag stuff in textarea, I
Oops, sorry about that.

*** This bug has been marked as a duplicate of 166866 ***
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE


5 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.