#23114 closed defect (bug) (duplicate)
Links created in Visual Editor are removed by Text Editor
Reported by: | Owned by: | ||
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.5 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
Links created in Visual Editor are not shown in Text Editor and any editing in Text mode cause links to be removed.
To reproduce:
- Open Post in Visual Editor.
- Select text to which link is to be added and click on Insert/Edit Link tool.
- Add the link.
- Switch to Text Editor. At this point you will notice that some extraneous have been added, and the link is not present.
- Remove an unwanted - or modify some HTML.
- Switch back to Visual Editor.
You will see that that the previously added link is no longer there.
Change History (13)
#2
@
12 years ago
- Keywords reporter-feedback removed
YES -
- Setup WP 3.5 base installation at test.smallbusinesswebspot.com.
- Made no changes to WP Settings.
- Added New Post. See My First Post on front page.
- Select text "Link to Sample page" and clicked on insert/edit link icon, and linked to Sample page.
- Switched to Text editor. No problems are evident.
- Switched to Visual editor and removed link.
- Selected ALL text and linked to Sample page as in step 4 above.
- Switched to Text editor. No problems are evident. Anchor appropriately wraps all text.
NOW THIS IS WHERE IT GETS INTERESTING
- Switched to Visual editor. Now only first line of text is underlined indicating that only the first line now has anchor. Switching back to Text editor confirms this. A closing anchor tag has been added after the first text line, and an NBSP has replaced the closing anchor tag after the last line.
- Removed anchor from first line.
- Selected first line and changed format from Paragraph to H3.
- Selected all text and linked to Sample page.
- Switched to Text editor. Anchor is present.
- Switched to Visual editor. Anchor has been removed and tags replaced with NBSP's.
Let me know if you need access to this test install.
#3
@
12 years ago
- Cc jacopo.tarantino@… added
- Keywords reporter-feedback added
I couldn't reproduce this either.
What browser are you using? Have you tried turning off all browser plugins?
#4
@
12 years ago
- Keywords reporter-feedback removed
I was using Chrome on a Mac.
I've now downloaded a clean Firefox and tried again with the same results.
I then tried with IE on Windows 7 with the same results.
This is a clean install of WP 3.5 with no changes to the settings.
I am beginning to think that it takes a new-be to screw up like a new-be. What is now clear to me is that the Visual editor is, probably by design, removing anchors that span block elements, and replacing their opening and closing tags with " ". This coding practice was also considered invalid HTML prior to HTML5. If you have been unable to reproduce this, my guess is this is because you knew better than to try to span block elements in the first place.
Am I right?
#5
@
12 years ago
- Keywords reporter-feedback added
Oh, are you saying you're having the link open and close in different blocks? I think that would definitely be something the editor would correct. Something like the following?
<p> <a href="blah"> foo </p> <p> bar </a> </p>
#6
@
12 years ago
- Keywords reporter-feedback removed
No No. That would be invalid syntax at any level of HTML. What I am doing is valid HTML5 as follows...
<a href="#"><h3> title </h3><p> stuff </p></a>
All blocks are fully contained within the anchor. This is valid syntax in HTML5, but apparently not yet supported in WP. This is done when one wants a larger anchor target area.
#7
@
12 years ago
I still can't reproduce this bug. Adding large blocks of text for me and then linking them(in the visual editor) actually produces the following:
<h3><a href="#">blah</a></h3>
<a href="#">more blah</a>
<p> tags are added later.
I'm sure something's not sitting right here but I don't know what. This is not expected behavior.
#8
@
12 years ago
I can't help but think that if you do what I am doing exactly as I am doing it, you should see the same result. We've already established that we're all using a clean install of WP 3.5 with no changes to the installed settings.
Create a Post. In the Visual editor, enter:
Heading
Paragraph text
Select line 1 and set format to Heading 2.
Select all text and link to the Sample Page.
Now switch to the text editor. If you have done what I did exactly as I've described it, you should indeed see what I see as follows.
<a title="Sample Page" href="http://test.smallbusinesswebspot.com/?page_id=2">
<h2>Heading</h2>
Paragraph text
</a>
Now switch back to the Visual editor. You should now see that none of the text is underlined indicating that the anchor has been removed completely.
Now switch to the Text editor again. You should see this.
<h2>Heading</h2>
Paragraph text
There is no anchor.
Next steps. If you do not see this then we must focus on why we are seeing something different. I suggest something like the following steps.
- You could log into my test WP to confirm my observations.
- We could then focus on identifying what is different between our environments.
Let me know what you think... and thank you for your kind attention and patience.
#11
@
12 years ago
- Cc mikezielonka@… added
- Severity changed from normal to major
Hi All.
I duplicated this on a clean install and recorded it for ya so you can follow the same steps. I even included a little audio lol
http://cloud.tunas.co/242f1T2p143z
Mike
Could not reproduce on a clean install.
Does this still happen with all plugins deactivated and using Twenty Twelve?