search for: strip_code_snippet

Displaying 1 result from an estimated 1 matches for "strip_code_snippet".

Did you mean: strip_code_snippets
2006 Dec 07
4
Removing a block of text within a string
...o html. I would like to write a helper that would accept the converted html text as a parameter, and just completely remove the <pre> snippet </pre> block if I''m not on the full post. So, I''d like something like this: <div class="body-text"> <%= strip_code_snippets(to_html(post.body)) %> </div> Can someone help me with how to do this? What would the "strip_code_snippets" method look like? I think I''d be fine finding the <pre> tag but I don''t know how to completely remove the text from <pre> to </pre>....