aboutsummaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/util.js b/lib/util.js
index b80ea04..9f17966 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -226,3 +226,10 @@ u.rows = function (str) {
u.token = function () {
return '__' + Math.random().toString(36).substr(2) + '__'
}
+
+u.unwrapP = function(html) {
+ return String(html).replace(/^<p>(.*)<\/p>\s*$/, function ($0, $1) {
+ return $1
+ })
+}
+