aboutsummaryrefslogtreecommitdiff
path: root/sx-encoding.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-12 22:28:54 -0500
committerSean Allred <code@seanallred.com>2014-11-12 22:28:54 -0500
commit276c374c284f058d24e81c3f29bbbc9c72183caf (patch)
tree1da1b6eebb7eb038324972f75435fddae589531d /sx-encoding.el
parentf1c3473e5b6d20c80b2f2f2ae569748fc247fccd (diff)
Introduce content cleaning functions
Diffstat (limited to 'sx-encoding.el')
-rw-r--r--sx-encoding.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/sx-encoding.el b/sx-encoding.el
index 0b72365..bea9071 100644
--- a/sx-encoding.el
+++ b/sx-encoding.el
@@ -74,6 +74,18 @@
(substring ss 1))))))))
(replace-regexp-in-string "&[^; ]*;" get-function string)))
+(defun sx-encoding-normalize-line-endings (string)
+ "Normalize the line endings for STRING"
+ (delete ? string))
+
+(defun sx-encoding-clean-content (string)
+ "Cleans STRING for display.
+Applies `sx-encoding-normalize-line-endings' and
+`sx-encoding-decode-entities'."
+ (sx-encoding-decode-entities
+ (sx-encoding-normalize-line-endings
+ string)))
+
(defun sx-encoding-gzipped-p (data)
"Checks for magic bytes in DATA.