Markdown knowledge import removes literal hashes from headings (C# becomes C)
まだ誰も着手していません。
評価
調査の方向性
api/core/rag/extractor/markdown_extractor.py の MarkdownExtractor.markdown_to_tups から始め、extract() のエントリポイントを追ってください。C# や Issue #123 のような見出しを含む例を再現し、その後 extract() を通じたパラメーター化されたリグレッションカバレッジを追加してください。見出しテキスト内のリテラルなハッシュが保持されたまま、開始マーカーと有効な任意の終了マーカーが処理されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
main at 5e51fe2640 (api version 1.17.0)
Cloud or Self Hosted
Self Hosted (Source). Reproduced at the extractor level; no running deployment was used.
Steps to reproduce
The built-in Markdown extractor is selected for .md, .markdown, and .mdx knowledge uploads when using the default ETL path. Its heading cleanup removes every #, including characters that belong to the title text.
A minimal extractor reproduction, run from api/ in a configured development environment:
from pathlib import Path
from tempfile import TemporaryDirectory
from core.rag.extractor.markdown_extractor import MarkdownExtractor
with TemporaryDirectory() as directory:
path = Path(directory) / "example.md"
path.write_text("# C#\nLanguage reference.\n\n## Issue #123\nIssue details.\n", encoding="utf-8")
docs = MarkdownExtractor(str(path), encoding="utf-8").extract()
for doc in docs:
print(repr(doc.page_content))
✔️ Expected Behavior
The nonempty documents retain C# and Issue #123 as their titles. Opening heading markers and optional closing heading markers may still be removed, as they are today.
❌ Actual Behavior
The titles become C and Issue 123. This silently changes the text ingested into the knowledge base, including programming language names and issue references.
The cause is re.sub(r"#", "", key) in MarkdownExtractor.markdown_to_tups, which removes hashes throughout the title.
This differs from #30940, which requested retaining the Markdown heading markers themselves. This report concerns literal characters in the heading content.
I would like to contribute a small fix that removes only the opening marker and valid optional closing markers, with parameterized regression coverage through extract(). Could a maintainer confirm the approach and assign this issue to @gallonyin?
- 主要言語
- TypeScript
- スター
- 157k
- フォーク
- 24.7k
- 平均マージ
- 22時間 32分
- マージ済み PR(30日)
- 611
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
langgenius/dify のほかの issue
-
Annotation Reply: a stored score threshold of 0.0 is silently replaced with 1, disabling the feature オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42639 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
langgenius/dify#42468 · コメント 1 件 · リアクション 1 件 ·
-
🐞 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
langgenius/dify#42446 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42355 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42350 · コメント 1 件 · リアクション 1 件 ·
langgenius/dify の issue をすべて見る
似ている issue
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Automattic/studio#4908 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100