#4745 closed Bug (invalid)
Editor doesn't handle empty anchor tags properly — at Version 2
Reported by: | Russ Tennant | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0.1 |
Keywords: | Cc: |
Description (last modified by )
Sample source with empty anchor:
<div> <a name="foo"/> Some Text <br /> <ol> <li> Item One </li> <li> Item Two </li> </ol> </div>
Becomes
<div> <a name="foo"> Some Text <br /> </a> <ol> <li> <a name="foo">Item One </a></li> <li> <a name="foo">Item Two </a></li> </ol> </div> <p> <a name="foo"></a></p>
Change History (2)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
The problem here is that in HTML the <a> tag is not an empty tag. The <a /> usage is not recognized by the browsers.
When the editor received the data, it sends it to the browser and malformed code, like <a />, gets automatically fixed. But in fact, the browser sees <a /> as the opening <a>, with no closing </a>, so the anchor get applied (and split) through the entire document.
Note that the editor will never create such kind of anchor code. It will be always <a name="foo"></a>.
We can hardly fix this issue at our side. You must instead avoid creating malformed HTML by hand as sometimes we're not able to predict the way the browser will behave with it.
Forgot steps to reproduce:
Copy the initial HTML into the source view.
Toggle the source view (click button twice)
The HTML will be transformed into something interesting, unexpected, and invalid with regard to the non-unique names :)