プロジェクト

全般

プロフィール

Vote #81375

未完了

Make wiki text section extraction less fragile

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
0
issue_org_id:
35037
author_id:
12098
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

The current approach to per-section text editing is inherently fragile:

  • Sections links are generated based on rendered HTML headings (before macro injections).
  • Section extraction from the markup source is based on simplified regexp-based parsing of the markup, independent on the fully featured markup parser.

The issue is going to be more significant after relaxing restrictions on markup syntax (#32424, #35035).
But as #35036 shows, even the current restrictions do not guarantee correct section extraction. See also the exmple below.

I can imagine two approaches to the solution:

For CommonMark - using the @sourcepos@ feature of the renderer. Also applicable to other eventual formatters with similar feature.

For any markup - introducing validation of the section extraction results, which would detect that the extraction fails and would disable per-section edit links.

I can offer creating a PoC of the @sourcepos@ approach for CommonMark format after #32424 is incorporated.

A difficult-to-solve example of Markdown with broken section extraction follows (copied from the skipped unit test in #35036):


# Title

## Heading 2

- item
one
-
not a heading

## Heading 2
Nulla nunc nisi, egestas in ornare vel, posuere ac libero.

journals

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


related_issues

relates,Closed,35036,Markdown text sections broken by thematic breaks (horizontal rules)

Admin Redmine さんが約2年前に更新

  • カテゴリText formatting_26 にセット

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

いいね!0
いいね!0