-
Type:
Bug
-
Resolution: Low Engagement
-
Priority:
Low
-
None
-
Affects Version/s: 5.5.5
-
Component/s: Repository - Source / Diff
-
1
-
Severity 3 - Minor
-
0
Summary
Ruby syntax in Bitbucket Server where the heredoc is not functioning properly correctly for its syntax highlighting. The following types of Here Documents are not functioning properly:
- indent
expected_result = <<-INDENTED_HEREDOC This would contain specially formatted text. That might span many lines INDENTED_HEREDOC
- squiggly
expected_result = <<~SQUIGGLY_HEREDOC This would contain specially formatted text. That might span many lines SQUIGGLY_HEREDOC
- single quotes
expected_result = <<-'EXPECTED' One plus one is #{1 + 1} EXPECTED - double quotes
puts <<-"HEREDOC" cat #{__FILE__} HEREDOC - backticks
puts <<-`HEREDOC` cat #{__FILE__} HEREDOC
Steps to Reproduce
- In the local repository, write poly.rb ruby script.
- Make the commit and push to the remote repository.
- View the file in the Source View page.
Expected Results
Bitbucket Server's source view page able to recognize the heredoc syntax and comment out/block out the content in between the heredoc.
Actual Results.
Bitbucket Server's source view page unable to recognize the heredoc syntax.
Workaround
Only the following heredoc syntax is recognized:
expected_result = <<HEREDOC This would contain specially formatted text. That might span many lines HEREDOC
The heredoc starts on the line following <<HEREDOC and ends with the next line that starts with HEREDOC. The result includes the ending newline.
More information
The syntax information was referred at - http://ruby-doc.org/core-2.3.0/doc/syntax/literals_rdoc.html#label-Here+Documents