diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /haml_lint/linter/no_plain_nodes.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'haml_lint/linter/no_plain_nodes.rb')
-rw-r--r-- | haml_lint/linter/no_plain_nodes.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/haml_lint/linter/no_plain_nodes.rb b/haml_lint/linter/no_plain_nodes.rb index c39f61fa80d..d0d9c165a19 100644 --- a/haml_lint/linter/no_plain_nodes.rb +++ b/haml_lint/linter/no_plain_nodes.rb @@ -51,6 +51,7 @@ module HamlLint attributes = node.attributes_source.map(&:last) attributes.each { |attribute| text = text.gsub(attribute, '') } + text = strip_html_entities(text) text.strip end @@ -77,7 +78,12 @@ module HamlLint def text_node?(node) return false unless plain_node?(node) - !node.text.empty? + text = strip_html_entities(node.text) + !text.empty? + end + + def strip_html_entities(text) + text.gsub(/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});/i, "") end end end |