views:

39

answers:

1

Hi.

I'm parsing forum threads with Nokogiri and putting them on RSS feed (forum itself doesn't have RSS or any other kind of news feeds), the problem I've encountered is following: elements are styled with CSS classes and via selectors in forums style file included in the page, I can't include it into news feed so I want to replace all class="..." attributes with style="". Any ideas how do I do that? Maybe there are some gems able to parse CSS and update Nokogiri parser?

A: 

You need to show a sample of what you are parsing, plus a sample of the code you've written.

In addition, RSS doesn't support styles so rather than replace class="..." with style="" just remove the class info. You can embed HTML in RSS items, but IMO that results in lousy looking feeds and can lead to problems farther down the road if someone else wants to reuse the data. Instead I'd recommend sanitizing the HTML or even stripping all tags.

Finally, with a 38% accept rate I'm not too inclined to spend a lot of time providing code. Please go accept some more answers. If you find you are not getting good answers then give people more to work with in your question.

Greg
html. its not something specific, so example is: xyz{padding: 2px;} <p class="xyz">example</p> - the end. there's no code i've written for this atm, so i didn't add it. if i could don't include any html i would do so.
Daniel