]>
cat aescling's git repositories - mastodon.git/blob - app/validators/html_validator.rb
1 # frozen_string_literal: true
3 class HtmlValidator
< ActiveModel
::EachValidator
4 def validate_each(record
, attribute
, value
)
6 record
.errors
.add(attribute
, I18n
.t('html_validator.invalid_markup')) unless valid_html
?(value
)
12 Nokogiri
::HTML.fragment(str
).to_s
== str
This page took 0.080588 seconds and 5 git commands to generate.