WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 9 days ago

#48583 new defect (bug)

Page Jumps Disappearing when Switching in Between Visual and Code editor

Reported by: Deon B Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.1
Component: Editor Keywords:
Focuses: Cc:
PR Number:

Description

Hello,
I am using wordpress 5.1.3 (that's the maximum my host lets me upgrade to - if I try to update to the latest I get an error my php is not enough etc).

When I switch in between visual and code editor (I installed the classic editor plugin), the page jumps disappear and are replaced by:
 

This is a problem that you have had in all wordpress versions I have used in the past 7 years. I had been told that after 5.0 this problem was going to be fixed but it's not.

Can you guys maybe suggest a workaround, some code, something I could do to make this page jumps work stick there when I keep swapping in between classic and text editor?

Change History (4)

#1 @SergeyBiryukov
3 months ago

  • Component changed from General to Editor

#2 @sabernhardt
3 months ago

@deon-b Thanks for the ticket! I see the same replacement can happen for empty anchor tags in 5.2 and 5.3 as well, but I found workarounds.

So either of these, on its own line (in the text editor), would be replaced by the non-breaking space for an empty paragraph when switching back and forth:

<span id="empty1"></span>

<a id="empty2"></a>

However, any of the options below should retain the ID/name attribute, so then links go directly to that paragraph (or heading).

<h2 id="option1">A heading with ID attribute</h2>

<p id="option2">A paragraph with ID attribute for an anchor link to skip to here.</p>

<span id="option3"></span>A paragraph with an anchor link's target at the beginning.

<a id="option4"></a>Another paragraph, with an anchor tag.

<span id="option5"></span>
This paragraph has an anchor link's target at the beginning, with a line break between that and the text.

<a id="option6"></a>
This also adds a line break after the anchor tag and before the text of this paragraph.

<a name="option7"></a>

#3 @Deon B
3 months ago

Hi,
thank you very much for the reply. I will be testing these and update you with the results.

Thank you
D.

#4 @SergeyBiryukov
9 days ago

#45540 was marked as a duplicate.

Note: See TracTickets for help on using tickets.