Add support for <del> tags - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset d8817ed832ed48fa67e1d82ca1d53cae95854728
(DIR) parent 323ab92fd4fa1683f3380b60ed0ce96f395ada39
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sun, 19 Aug 2018 00:48:05
Add support for <del> tags
Show text inside them as `~~deleted text~~'.
Diffstat:
lobsters/comments.dcgi | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff -r 323ab92fd4fa -r d8817ed832ed lobsters/comments.dcgi
--- a/lobsters/comments.dcgi Mon Aug 13 13:13:04 2018 +0200
+++ b/lobsters/comments.dcgi Sun Aug 19 00:48:05 2018 +0200
@@ -28,6 +28,7 @@
function html2text(s) {
gsub(/<\/a>/, "", s)
gsub(/<\/code>/, "", s)
+ gsub(/<\/del>/, "~~", s)
gsub(/<\/em>/, "", s)
gsub(/<\/li>/, "", s)
gsub(/<\/ol>/, "", s)
@@ -44,6 +45,7 @@
gsub(/<a href="[^"]+" rel="nofollow">/, "", s)
gsub(/<a href="[^"]+">/, "", s)
gsub(/<code>/, "", s)
+ gsub(/<del>/, "~~", s)
gsub(/<em>/, "", s)
gsub(/<strong>/, "", s)
gsub(/&/, "\\&", s)