On Sunday 20 January 2008, Andrew ft wrote:
Please tell me if this is a bad idea, but how about this as a solution: If you are only interested in minimal markup, like the ability to use the <em> tag, what about using a special character to indicate it in the node title, and then processing the title at the theme layer (for example with a regular expression) to convert the characters into tags. For example, you could use Hello *World!* as the node title and then convert this with a simple regular expression to Hello <em>World!</em> when the node is rendered. This would have the added advantage of keep clean the RSS feed from the node. It would also be much shorter than putting markup in the title, bearing in mind the 255 char limit. Would this be classified as a hack?
That's a very good idea! It has the advantage that in all places that output check_plain($node->title) will show a reasonable string after all. As long as the required markup is limited - this is the most elegant solution I've seen! Thanks, --yuval