Sha256: 39c5f59fbde079c9dae9a897f29c4eaa8cffd9f592d15832e74aa7e3630012f0
Contents?: true
Size: 1.36 KB
Versions: 6
Compression:
Stored size: 1.36 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>html_sanitise (WebT2App)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File pkg/t2-web-0.0.2/bin/web_t2_service.rb, line 34</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">html_sanitise</span>(<span class="ruby-identifier">string</span>) <span class="ruby-comment cmt"># escape double quotes characters</span> <span class="ruby-identifier">ex</span> = <span class="ruby-identifier">string</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'"'</span>, <span class="ruby-value str">'&quot;'</span>) <span class="ruby-comment cmt"># convert newlines to HTML newlines to display in textareas inputs</span> <span class="ruby-identifier">ex</span> = <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[\n]/</span>, <span class="ruby-value str">'&#xA;'</span>) <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
6 entries across 6 versions & 1 rubygems