You are not logged in.
Hello,
I really need to have i and b html tags instead of em and strong.
I read in the forums that this behaviour used to be browser-dependent in the past, but now it seems both firefox and IE are using em and strong.
Is there a way to set xinha so that it outputs good old i and b tags? Maybe I should hack the code and brutally add a replacement instruction somewhere, but I am too noob to do it myself! :-D
Thanks in advance for your help!
Last edited by Ugo (2008-04-16 10:03:39)
Offline
I would just replace it server side with a regexp, if you're using php
$HTMLFromXinha = preg_replace('/<(\/?)strong>/', '<$1b>', $HTMLFromXinha);
$HTMLFromXinha = preg_replace('/<(\/?)em>/', '<$1i>', $HTMLFromXinha);
James Sleeman
Offline
I think you could also use the xinha._config.specialReplacements option in the config file, e.g.
xinha_config.specialReplacements = {
'<i(\s[^>]*)?>' : '<em$1>',
'<\/i>' : '<\/em>'
};
(and then the same for <b ...> <strong ...>). This would turn all <i ...> to <em ...> on the way into xinha and would convert them all back again to <i ...> on the way out. You'd need to check the backslashes, because I think the specialReplacements function might do its own escaping of regex strings...
-- Geoffrey
Offline
This will not work this way as you can't simply put RegExps in an object like this. Please have a look at this ticket which contains a means to do this http://xinha.webfactional.com/ticket/1201
Offline