gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 274 forks source link

kramdown 2.3.0 test failure with ruby-rouge 3.23.0 #689

Closed dleidert closed 3 years ago

dleidert commented 4 years ago

My Environment

Software Version(s)
Operating System Debian
kramdown 2.3.0
ruby-rouge 3.25.0

Expected Behaviour

Up to ruby-rouge 3.21.0 the tests succeeded as expected. With the latest release two tests fail expecting different output.

Current Behavior

  1) Failure:
TestFiles#test_/<<BUILDDIR>>/ruby-kramdown-2_3_0/test/testcases/block/06_codeblock/rouge/simple_text_to_html [/<<PKGBUILDDIR>>/test/test_files.rb:56]:
--- expected
+++ actual
@@ -5,7 +5,7 @@
 </code></pre>
 </div></div>

-<div class=\"language-php highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$foo</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nx\">Ba
r</span><span class=\"p\">;</span>
+<div class=\"language-php highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$foo</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nc\">Ba
r</span><span class=\"p\">;</span>
 </code></pre>
 </div></div>
 "

  2) Failure:
TestFiles#test_/<<BUILDDIR>>/ruby-kramdown-2_3_0/test/testcases/block/06_codeblock/rouge/multiple_text_to_html [/<<PKGBUILDDIR>>/test/test_files.rb:56]:
--- expected
+++ actual
@@ -6,7 +6,7 @@
 </code></pre>
 </div></div></div>

-<div class=\"language-php highlighter-rouge\"><div class=\"custom-class\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$foo</span> <span class=\"o\">=</span> <span class=\"k\">new<
/span> <span class=\"nx\">Bar</span><span class=\"p\">;</span>
+<div class=\"language-php highlighter-rouge\"><div class=\"custom-class\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$foo</span> <span class=\"o\">=</span> <span class=\"k\">new<
/span> <span class=\"nc\">Bar</span><span class=\"p\">;</span>
 </code></pre>
 </div></div></div>
 "

Note the class="nx" vs class="nc" output.

I reported the issue to the rouge project too rouge-ruby/rouge#1603. But it seems it is considered as "updated behavior". Can you please check and handle the change?

pvalena commented 4 years ago

Same failure in Fedora.

gettalong commented 3 years ago

Thanks - I have updated the tests and the requirements for rouge.