I've tried a few different techniques now but I can't get one to work reliably across all content. What I need to do is have all instances of the business name include a trademark symbol:
ie -> DinosaurCakes
becomes DinosaurCakes<sup>&tm;</sup>
or
Would you like some DinosaurCakes?
becomes Would you like some DinosaurCakes<sup>&tm;</sup>
The javascript version I was trying to do was looping through the page on load and replacing the string with the function I found here-> http://james.padolsey.com/javascript/find-and-replace-text-with-javascript/ But it isn;t digging in to all of the child nodes for some reason and so some versions of the string don;t get replaced.
I then tried to do it in Drupal via hook_page_alter with:
function dinosaur_page_alter(&$page) {
// attempting to add the DinosaurCake (tm) marks using page_alter
// find all '#markup' and then scan for terms
function display_array(&$your_array){
foreach ($your_array as $key => &$value){
if (is_array($value)){
display_array($value);
}
elseif (is_string($value) && $key === "#markup") {
$value = str_replace(array('DinosaurCakes"), array('DinosaurCakes<sup class="reg">&tm;</sup>'), $value);
}
}
}
display_array($page);
}
However, using this method, it doesn't work on headings and does apply to title attributes and pathnames which of course breaks everything.
Any ideas on the best way to attack this?