WordPress.org

Making WordPress.org

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#5572 closed defect (fixed)

Plugin FAQ anchor links get broken when used in a forum post

Reported by: johnbillion Owned by: dd32
Milestone: Priority: normal
Component: Support Forums Keywords:
Cc:

Description

I've noticed that when I copy a URL to a plugin FAQ and paste it in a support forum reply, it gets broken. The copied link is correct and works, it just gets mangled when saved in the forum reply.

Latest example here: https://wordpress.org/support/topic/tracking-user-switching/#post-13898580

This is an affected link, seems to work okay in Trac: https://wordpress.org/plugins/user-switching/#%0Aare%20any%20plugin%20actions%20called%20when%20a%20user%20switches%20account%3F%0A

Change History (5)

#1 @diddledani
11 months ago

The forum is stripping the %0A encoded character at the beginning and end of the fragment in the URL. %0A is the encoded newline character. I think the forum is correct, here, and the fix should be applied to the plugin pages to trim() the FAQ titles before encoding/escaping the URL.

#2 @dd32
11 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 10573:

Plugin Directory: When generating FAQ anchors, don't include trailing whitespace as part of the ID.

This also updates the format of pre-defined ID's to match the format used today, as the ID's were previously being stripped out by kses, there's no real change here.

The Decode/Encode and trimming works around the various different anchor formats used.

Fixes #5572.

#3 @dd32
11 months ago

In 10574:

Plugin Directory: Bump JS cache after [10573].

See #5572.

#4 @ryelle
11 months ago

In 10606:

Plugin Directory: Stop adding a # when generating FAQ IDs in JavaScript.

This keeps the behavior consistent between PHP and JS.

See #5572.

#5 @ryelle
11 months ago

In 10607:

Plugin Directory: Bump JS cache after [10606].

See #5572.

Note: See TracTickets for help on using tickets.