Defect #35892

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

Added by Go MAEDA about 1 year ago. Updated 4 months ago.

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

0%

Category:Gems support
Target version:5.0.2
Resolution:Fixed 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 - Feature #32424: CommonMark Markdown Text Formatting Closed

Associated revisions

Revision 21226
Added by Marius BALTEANU 12 months ago

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

Revision 21611
Added by Marius BALTEANU 4 months ago

Update commonmarker gem to 0.23.4 (#37136).

Revision 21612
Added by Marius BALTEANU 4 months ago

Update footnotes markup after commonmarker gem update (#35892).

Revision 21618
Added by Marius BALTEANU 4 months ago

Fix failing test (#35892).

Revision 21619
Added by Marius BALTEANU 4 months ago

Merged r21618 to trunk (#35892).

History

#1 Updated by Go MAEDA about 1 year ago

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

#2 Updated by Marius BALTEANU about 1 year ago

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

#3 Updated by Holger Just about 1 year 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 about 1 year 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 12 months 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 12 months ago

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

#7 Updated by Ko Nagase 12 months ago

Okay, thanks for the fix!

#9 Updated by Marius BALTEANU 4 months ago

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

#10 Updated by Marius BALTEANU 4 months ago

  • Status changed from New to Resolved
  • Resolution set to Fixed

Proper fix committed in r21612.

#11 Updated by Marius BALTEANU 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF