WordPress mu-plugin that replaces colon with dash before saving content to database.
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.
- In your
wp-content
directory, create amu-plugin
directory if it not already exists. - Copy
kntnt-fix-colon-in-fragments-of-relative-urls.php
intomu-plugin
. Only the file. Not this directory or the other files within it.
Initial release.