I didn't make it to change in the preview at all, it's only written to affect the article when you view the article itself. It definitely works on my default test site. Post a link to an article on your site that we can see.
I made a mistake Lynne, apologies..... The code went on to one line without a space and that caused the error on the article in full view. That now works. Is there a way to do the same in the preview in a section homepage?