A Better Acronym Replacer for WordPress
I use the now defunct Acronym Replacer by Joel Bennett of Huddled Masses. Since I do not need any text replacement apart for acronyms, the incentive to move forward to Ubernyms is quite low as far as I am concerned.
I just added a functionality to Acronym Replacer 2.8. In addition to wrapping acronyms with the appropriate tag and title, it now also adds a discreet link to Wikipedia, as in these examples: HTML, RSS.
In Acronym Replacer 2.8, the acronym replacement command goes as follows:
$text = preg_replace("|(?!< [^<>]*?)(?< ![?./&])\b$acronym\b(?!:)(?![^<>]*?>)|imsU","$acronym" , $text);
The following inserts an additional link to Wikipedia:
$text = preg_replace("|(?!< [^<>]*?)(?< ![?./&])\b$acronym\b(?!:)(?![^<>]*?>)|imsU","$acronym" , $text);
My own choice was to make the link appear black (color:#000) and to set the Wikipedia link to the English Wikipedia (en.wikipedia.org) website. Both parameters are obviously easily modifiable.Sur le même sujet :
- WordPress 2.5, point technique Résumées ci-dessous, quelques modifications pascales sur ce blog. Cela ne risque pas d’intéresser grand monde, mais je documente systématiquement mes...
- Le WYSIWYG WordPress sous Firefox est instable Une partie de l’article sur le CPE à l’IEP de Grenoble a disparu suite à un reformatage très imprudent du...
- A message to U.S. readers French sociologist Baptiste Coulmont is quite startled about his blog being censored in some universities in the United States. If...
2 Comments
→



You know, even if all you’re using it for is abbreviations, you’re better off with Ubernyms because it would use the right tag instead of the acronym tag for things like “HTML” that aren’t actually acronyms ;) That’s actually why I finally released it: I added the ability to say that some acronyms are obscure (to your readers), and you want to place the full text in the article (in parentheses) the first time you use it… which is the correct way to do it.
I realized that I’m tired of people arguing about
ABBRvsACRONYM(becauseABBRdoesn’t show up highlighted in IE) when they should just write it as they would on paper, and then add a tag to help the computers understand what’s going on (and read it correctly to blind people).in English, and – apart from all the semantics of adding tags for the computer to read.
Anyway, feel free to keep using and improving the old one of course!
It’s a sound argument that we should be using at least two different tags for acronyms and abbreviations (though I tend to disagree: HTML can be considered an acronym to a large extent).
Yet Ubernyms would be jumping to a higher level of sophistication: I am not sure I need to get down that road, I would rather go for the Wikipedia linkage. I will have to consider both in the future (I guess that I will opt, in the end, for Ubernyms, because I believe we are both part of that kind of überperfectionists who use complicated plugins for stuff that a vast majority of people do not give a straight damn about).