Sha256: 7593164726b595d7aec04dd442a23ff231f4a549ed17925cdd862be2070250fb

Contents?: true

Size: 808 Bytes

Versions: 68

Compression:

Stored size: 808 Bytes

Contents

<h1>Rails HTML Sanitizer</h1>

<p>Read more here <a href="https://github.com/rails/rails-html-sanitizer">rails-html-sanitizer</a></p>

<textarea rows="4" cols="200">
full_sanitizer = Rails::Html::FullSanitizer.new
full_sanitizer.sanitize("<b>Bold</b> no more!  <a href='more.html'>See more here</a>...")
</textarea>

<hr>
<%=
  Rails::Html::FullSanitizer
    .new
    .sanitize("<b>Bold</b> no more!  <a href='more.html'>See more here</a>...")
%>

<br/><br/><br/>

<hr>

<textarea rows="4" cols="200">
link_sanitizer = Rails::Html::LinkSanitizer.new
link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>')
# => Only the link text will be kept.
</textarea>

<%=
  Rails::Html::LinkSanitizer
    .new
    .sanitize('<a href="example.com">Only the link text will be kept.</a>')
%>

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.5 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.4 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.3 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.2 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.1 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.3.0 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.43 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.42 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.41 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.40 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.39 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.38 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.37 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.36 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.35 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.34 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.33 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.32 after_templates/addons/rails_html_sanitizer/home/index.html.erb
rails_app_generator-0.2.31 after_templates/addons/rails_html_sanitizer/home/index.html.erb