るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.079秒)

別のキーワード

  1. cgi/html doctype
  2. cgi/html form
  3. cgi/html element_init
  4. cgi/html multipart_form
  5. cgi/html textarea

ライブラリ

モジュール

検索結果

ERB::Util.#html_escape(s) -> String (45325.0)

文字列 s を HTML用にエスケープした文字列を返します。

文字列 s を HTML用にエスケープした文字列を返します。

文字列 s 中に含まれる &"<> を、実体参照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}

ERB::Util.#h(s) -> String (25.0)

文字列 s を HTML用にエスケープした文字列を返します。

文字列 s を HTML用にエスケープした文字列を返します。

文字列 s 中に含まれる &"<> を、実体参照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby]{
require "erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}