Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 18:21:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 18:21:10 +0300
commite33f87ac0fabaab468ce4b457996cc0f1b1bb648 (patch)
tree8bf0de72a9acac014cfdaddab7d463b208294af2 /haml_lint
parent5baf990db20a75078684702782c24399ef9eb0fa (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'haml_lint')
-rw-r--r--haml_lint/linter/no_plain_nodes.rb8
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