Module: NoraMark::Html::Util

Included in:
FrontmatterWriter, Generator, TagWriter
Defined in:
lib/nora_mark/html/util.rb

Instance Method Summary collapse

Instance Method Details

#escape_html(string) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/nora_mark/html/util.rb', line 4

def escape_html(string)
  string.to_s.gsub("&", "&")
        .gsub("<", "&lt;")
        .gsub(">", "&gt;")
        .gsub('"', "&quot;")
        .gsub("'", "&#39;")
end