File: filters-apply-HTML-escaping.patch

package info (click to toggle)
cgit 0.10.2.git2.0.1-3%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 26,640 kB
  • ctags: 19,675
  • sloc: ansic: 159,238; sh: 129,259; perl: 29,890; tcl: 21,214; python: 5,362; makefile: 3,295; lisp: 1,786; php: 120; asm: 98; csh: 45
file content (23 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 13c2d3df0440ce04273de3149631a9bd97490c6e Mon Sep 17 00:00:00 2001
From: Lazaros Koromilas <lostd@2f30.org>
Date: Wed, 15 Jul 2015 15:53:12 +0300
Subject: [PATCH] filters: apply HTML escaping

http://www.w3.org/International/questions/qa-escapes#use
---
 filters/html-converters/txt2html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/filters/html-converters/txt2html b/filters/html-converters/txt2html
index a795995..495eece 100755
--- a/filters/html-converters/txt2html
+++ b/filters/html-converters/txt2html
@@ -1,4 +1,4 @@
 #!/bin/sh
 echo "<pre>"
-cat
+sed "s|&|\\&amp;|g;s|'|\\&apos;|g;s|\"|\\&quot;|g;s|<|\\&lt;|g;s|>|\\&gt;|g"
 echo "</pre>"
-- 
2.8.0.rc3