Created
June 14, 2010 01:30
-
-
Save miebach/437163 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_surrounding_p_tag(s) { | |
//converts '<p>xyz</p>' to 'xyz', good for showdown | |
return s.replace(/^<p>|<\/p>$/g,""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you call the showdown / markdown converter (http://github.com/kriskowal/markdown), it will surround the resulting code with additional
<p>..</p>
tags. If you want to remove them afterwards you can use this function.