* [PATCH] oldweb: use native String#encode for (X)HTML escaping
@ 2017-01-24 23:28 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2017-01-24 23:28 UTC (permalink / raw)
To: olddoc-public
This allows us to avoid loading the 'cgi' library.
---
lib/oldweb.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/oldweb.rb b/lib/oldweb.rb
index b1b7c46..910afaf 100644
--- a/lib/oldweb.rb
+++ b/lib/oldweb.rb
@@ -5,7 +5,6 @@ require 'rdoc'
require 'erb'
require 'pathname'
require 'yaml'
-require 'cgi'
require 'uri'
# oldweb is an \RDoc template and not intended as a programming API.
@@ -288,7 +287,7 @@ class Oldweb
# reach into RDoc internals to generate less HTML
module LessHtml # :nodoc:
def accept_verbatim(verbatim)
- @res << "\n<pre>#{CGI.escapeHTML(verbatim.text.rstrip)}</pre>\n"
+ @res << "\n<pre>#{verbatim.text.rstrip.encode(xml: :text)}</pre>\n"
end
def accept_heading(heading)
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-24 23:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 23:28 [PATCH] oldweb: use native String#encode for (X)HTML escaping Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/olddoc.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).