Make WordPress Core

Opened 16 months ago

Closed 3 months ago

#48583 closed defect (bug) (worksforme)

Page Jumps Disappearing when Switching in Between Visual and Code editor

Reported by: Deon B Owned by:
Milestone: Priority: normal
Severity: major Version: 5.1
Component: Editor Keywords: close 2nd-opinion
Focuses: Cc:


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 (7)

#1 @SergeyBiryukov
16 months ago

  • Component changed from General to Editor

#2 @sabernhardt
16 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
16 months ago

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

Thank you

#4 @SergeyBiryukov
13 months ago

#45540 was marked as a duplicate.

#5 @sabernhardt
3 months ago

  • Keywords close 2nd-opinion added

The results with those examples are still the same using WordPress 5.6 (RC1), but are the 7 working options good enough?

#6 @Deon B
3 months ago

Hi, I am using this:
<a href="#overall"></a>
<a name="overall"></a>
and it works like this.

#7 @sabernhardt
3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Thanks for the feedback. I'll close it then.

If anyone wants to add support for the empty links/spans with an id, you can reopen the ticket.

Note: See TracTickets for help on using tickets.