Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Fix Special Characters in Image Titles
- // @namespace http://cjk.net.au
- // @version 0.1
- // @description Replaces wordpress-mangled special html entities on Twenty Sided (http://www.shamusyoung.com/twentysidedtale/)
- // @author CJ Kerr
- // @match http://www.shamusyoung.com/twentysidedtale/*
- // @grant none
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
- // ==/UserScript==
- // Replace Malformed Unicode entities
- this.$ = this.jQuery = jQuery.noConflict(true);
- $(document).ready(function()
- {
- $("img").each(function(index) {
- var altText = $(this).attr("title");
- if (altText != undefined) {
- var newAltText = altText.replace(/’/g, "\u2019").replace(/“/g, "\u201C").replace(/”/g, "\u201D");
- $(this).attr("title", newAltText);
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement