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>2022-04-13 21:08:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-13 21:08:33 +0300
commit953eb09e086c8f2842512a62e56e32223b5bf974 (patch)
tree3915a57e930263b7c31a1b5e819db50f7d3a609f /haml_lint
parent907fd5d94ecec19ff7de4986e83e75e6fa082558 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'haml_lint')
-rw-r--r--haml_lint/linter/documentation_links.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/haml_lint/linter/documentation_links.rb b/haml_lint/linter/documentation_links.rb
index 8c696b26b13..0cabae40c4b 100644
--- a/haml_lint/linter/documentation_links.rb
+++ b/haml_lint/linter/documentation_links.rb
@@ -68,7 +68,15 @@ module HamlLint
# Sometimes links are provided via data attributes in html tag
return node.parsed_attributes.syntax_tree if node.type == :tag
- node.parsed_script.syntax_tree
+ parse_script(node).syntax_tree
+ end
+
+ def parse_script(node)
+ # It's a workaround for cases for scripts ending with "do"
+ # For some reason they don't parse correctly
+ code = node.script.delete_suffix(' do')
+
+ HamlLint::ParsedRuby.new(HamlLint::RubyParser.new.parse(code))
end
def detect_path_to_file(link)