プロジェクト

全般

プロフィール

Vote #81644

未完了

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

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Gems support_45
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
45
version_id:
33
issue_org_id:
35892
author_id:
332
assigned_to_id:
107353
comments:
7
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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 @@
-"

This is some text1.

  1. This is the foot note

" +"

This is some text1.

  1. This is the foot note

" 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

journals

--------------------------------------------------------------------------------

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

* The format change of the footnote IDs was comitted in https://github.com/github/cmark-gfm/pull/230
* The missing @id@ for the back references however looks strange... Maybe we have to do something different here?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Okay, thanks for the fix!
--------------------------------------------------------------------------------


related_issues

relates,Closed,32424,CommonMark Markdown Text Formatting

Admin Redmine さんが3年以上前に更新

  • カテゴリGems support_45 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0