Project

General

Profile

Actions

Defect #35892

closed

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

Added by Go MAEDA over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Gems support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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


Files

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

Related issues

Related to Redmine - Feature #32424: CommonMark Markdown Text FormattingClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Go MAEDA over 3 years ago

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

Updated by Marius BĂLTEANU over 3 years ago

  • Assignee set to Marius BĂLTEANU
  • Target version set to 5.0.0
Actions #3

Updated by Holger Just over 3 years 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.

Actions #4

Updated by Ko Nagase about 3 years 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.

Actions #5

Updated by Marius BĂLTEANU about 3 years 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.

Actions #6

Updated by Marius BĂLTEANU about 3 years ago

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

Updated by Ko Nagase about 3 years ago

Okay, thanks for the fix!

Actions #9

Updated by Marius BĂLTEANU over 2 years ago

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

Updated by Marius BĂLTEANU over 2 years ago

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

Proper fix committed in r21612.

Actions #11

Updated by Marius BĂLTEANU over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF