diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 18:21:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 18:21:10 +0300 |
commit | e33f87ac0fabaab468ce4b457996cc0f1b1bb648 (patch) | |
tree | 8bf0de72a9acac014cfdaddab7d463b208294af2 /haml_lint | |
parent | 5baf990db20a75078684702782c24399ef9eb0fa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'haml_lint')
-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 |