Skip to content

WordPress mu-plugin that replaces colon with dash before saving content to database.

License

Notifications You must be signed in to change notification settings

Kntnt/kntnt-fix-colon-in-fragments-of-relative-urls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Kntnt Fix Colon in Fragments of Relative URLs

WordPress mu-plugin that replaces colon with dash before saving content to database.

Description

Colon is allowed in the fragment part of a URI according to RFC 3986 and is allowed in id and name in both HTML4 and HTML5. Despite these facts, WordPress removes everything up to and including the colon when a colon is used in a fragment of a relative or a protocol-relative URL. An example when this cause problem is when HTML generated by Markdown Extra is used, since colon is used in fragments to both link to the footnote (e.g. #fn:1) and link back (e.g. #fnref:1). Thus the need for this "hack" which replace colon with a dash in id and name attributes, and in href attributes that are relative (i.e. not starting with http://, https://. This is done before KSES runs and the post content is saved to the database.

Installation

  1. In your wp-content directory, create a mu-plugin directory if it not already exists.
  2. Copy kntnt-fix-colon-in-fragments-of-relative-urls.php into mu-plugin. Only the file. Not this directory or the other files within it.

Changelog

1.0.0

Initial release.

About

WordPress mu-plugin that replaces colon with dash before saving content to database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages