Defect #35892

Redmine::WikiFormatting::CommonMark::FormatterTest#test_footnotes fails with CommonMarker 0.23.2

Added by Go MAEDA 28 days ago. Updated 16 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Marius BALTEANU% Done:

0%

Category:Gems support
Target version:Candidate for next minor release
Resolution: Affected version:

Description

0.23.2:

$ bin/rails test test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb:143
Run options: --seed 26353

# Running:

F

Failure:
Redmine::WikiFormatting::CommonMark::FormatterTest#test_footnotes [/Users/maeda/redmines/redmine-trunk/test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb:159]:
--- expected
+++ actual
@@ -1 +1 @@
-"<p>This is some text<sup><a href=\"#fn1\" id=\"fnref1\">1</a></sup>.</p> <ol><li id=\"fn1\"><p>This is the foot note <a href=\"#fnref1\">↩</a></p></li></ol>" 
+"<p>This is some text<sup><a href=\"#fn-1\">1</a></sup>.</p> <ol><li><p>This is the foot note <a href=\"#fnref-1\" aria-label=\"Back to content\">↩</a></p></li></ol>" 

rails test test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb:143

Finished in 0.057364s, 17.4325 runs/s, 17.4325 assertions/s.
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips

0.23.1:

$ bin/rails test test/unit/lib/redmine/wiki_formatting/common_mark/formatter_test.rb:143
Run options: --seed 18906

# Running:

.

Finished in 0.035158s, 28.4430 runs/s, 28.4430 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

fix_common-mark-test.patch Magnifier (1.55 KB) Ko Nagase, 2021-09-25 17:47


Related issues

Related to Redmine - Patch #32424: CommonMark Markdown Text Formatting Closed

Associated revisions

Revision 21226
Added by Marius BALTEANU 16 days ago

Stick commonmarker gem to 0.23.1 when Ruby version >= 2.6 (#35892, #32424).

History

#1 Updated by Go MAEDA 28 days ago

  • Related to Patch #32424: CommonMark Markdown Text Formatting added

#2 Updated by Marius BALTEANU 28 days ago

  • Assignee set to Marius BALTEANU
  • Target version set to 5.0.0

#3 Updated by Holger Just 28 days ago

This seems to be related to https://github.com/gjtorikian/commonmarker/pull/148 which updated cmark-gfm to 0.29.0.gfm.2. There, they did in fact changed the footnote handling.

#4 Updated by Ko Nagase 23 days ago

How about to change the test code side by regexp match as a workaround ?
Attached patch supports both CommonMarker "== 0.23.2" and "<= 0.23.1" tests.

#5 Updated by Marius BALTEANU 16 days ago

I have locked commonmarker to 0.23.1 until we find a better way to handle the footnotes because the new format doesn't affect only the tests, it affects also the logic from sanitization_filter (source:trunk/lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb#L70) and we need to support both ways depending on the Ruby version.

#6 Updated by Marius BALTEANU 16 days ago

  • Target version changed from 5.0.0 to Candidate for next minor release

#7 Updated by Ko Nagase 16 days ago

Okay, thanks for the fix!

Also available in: Atom PDF