Use a CSS rule to style it?
code { white-space: pre; }
or:
code { white-space: nowrap; }
You're just asking for a headache if you try to match paired and
possibly nested HTML tags with a Regexp. (Not that it can't be done,
but it gets ugly fast and you need a very capable regular expression
engine like Oniguruma from Ruby1.9)
-Rob
http://www.w3.org/TR/CSS2/text.html#white-space-prop
On Apr 29, 2009, at 2:09 PM, Gavin wrote:
>
> Hi all
>
> I'm having a bit of trouble trying to acheive something, maybe someone
> can help?
>
> I have a model Article, which has an attribute 'body'
>
> The body is a text column in which people can add text and HTML.
>
> I'd like to edit certain properties of some of the HTML tags, for
> example, converting all spaces inside <code> </code> tags to
>
> I presume using a reg expression is the best way to achieve this, I'm
> just not sure of how to word an expression to scan for only characters
> within the html tags.
>
> any ideas?
>
> Ta
>
> Gavin
> >
Rob Biedenharn http://agileconsultingllc.com
[email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---