From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D40A41F6DC for ; Tue, 24 Jan 2017 23:28:11 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] oldweb: use native String#encode for (X)HTML escaping Date: Tue, 24 Jan 2017 23:28:11 +0000 Message-Id: <20170124232811.32157-1-e@80x24.org> List-Id: 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
#{CGI.escapeHTML(verbatim.text.rstrip)}
\n" + @res << "\n
#{verbatim.text.rstrip.encode(xml: :text)}
\n" end def accept_heading(heading) -- EW