summaryrefslogtreecommitdiff
path: root/test/syntax_highlighter_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-10-26 23:57:31 -0600
committerGitHub <noreply@github.com>2020-10-26 23:57:31 -0600
commit882cc2403dfe9c02828dc6a2d6065afd5088ed49 (patch)
tree17dabc0ac2f47f8a4055be13a0cffe9aaab46c41 /test/syntax_highlighter_test.rb
parent6a0e229340a2aaa83d9b16a3b6aaeaae17d90440 (diff)
resolves #3786 retain attribute order on HTML code tag for source block to remain consistent with output from 1.5.x (PR #3787)
Diffstat (limited to 'test/syntax_highlighter_test.rb')
-rw-r--r--test/syntax_highlighter_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/syntax_highlighter_test.rb b/test/syntax_highlighter_test.rb
index 4ca334b7..189b895a 100644
--- a/test/syntax_highlighter_test.rb
+++ b/test/syntax_highlighter_test.rb
@@ -564,6 +564,19 @@ context 'Syntax Highlighter' do
end
context 'Highlight.js' do
+ test 'should add data-lang as last attribute on code tag when source-highlighter is highlight.js' do
+ input = <<~'EOS'
+ :source-highlighter: highlight.js
+
+ [source,ruby]
+ ----
+ puts 'Hello, World!'
+ ----
+ EOS
+ output = convert_string_to_embedded input, safe: :safe
+ assert_includes output, '<code class="language-ruby hljs" data-lang="ruby">'
+ end
+
test 'should include remote highlight.js assets if source-highlighter attribute is highlight.js' do
input = <<~'EOS'
:source-highlighter: highlight.js