List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] filters: apply HTML escaping
@ 2015-07-15 12:53 lostd
  2015-08-12 12:11 ` Jason
  0 siblings, 1 reply; 3+ messages in thread
From: lostd @ 2015-07-15 12:53 UTC (permalink / raw)


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..3f12f90 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>"
-- 
1.9.5



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] filters: apply HTML escaping
  2015-07-15 12:53 [PATCH] filters: apply HTML escaping lostd
@ 2015-08-12 12:11 ` Jason
  2015-08-12 12:13   ` Jason
  0 siblings, 1 reply; 3+ messages in thread
From: Jason @ 2015-08-12 12:11 UTC (permalink / raw)


Presumably that document's concern about apos is outdated, and it's kosher
in modern browsers?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20150812/5d4b1dc7/attachment.html>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] filters: apply HTML escaping
  2015-08-12 12:11 ` Jason
@ 2015-08-12 12:13   ` Jason
  0 siblings, 0 replies; 3+ messages in thread
From: Jason @ 2015-08-12 12:13 UTC (permalink / raw)


Applied with some modifications -- \& goes to \\& because of shell single
quote.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20150812/6e010be5/attachment.html>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-12 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 12:53 [PATCH] filters: apply HTML escaping lostd
2015-08-12 12:11 ` Jason
2015-08-12 12:13   ` Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).