aboutsummaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-07-26 11:57:07 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-07-26 12:03:40 -1000
commitcab781470c10d358f770475c7b25d87e29f614bb (patch)
treed4b68301107ae9a21023cbefb94dbc8cf0d1e38f /lib/util.js
parent09f70e5f94777bbe5a18d2980ca221360642a970 (diff)
downloadpatchfoo-cab781470c10d358f770475c7b25d87e29f614bb.tar.gz
patchfoo-cab781470c10d358f770475c7b25d87e29f614bb.zip
Render post edits and diffs
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
+ })
+}
+