IpynbConverter uses a comment inside a Markdown code fence as the notebook title
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 77/100
调研方向
找到提取笔记本标题的 IpynbConverter 代码,然后阅读它如何处理行列表形式的 Markdown 源和 metadata.title。使用提供的笔记本复现问题,并检查现有转换器测试中关于标题提取的部分。完成标准是:即使前面有围栏代码块注释,第一个实际标题仍作为标题,同时 Markdown 正文和显式的 metadata.title 覆盖行为保持不变。
由索引模型根据 Issue 内容生成。
描述
What happened
A valid Jupyter Markdown cell with a fenced code example before its first real heading can get the wrong DocumentConverterResult.title. The Markdown body is preserved.
Minimal reproduction
Tested with MarkItDown 0.1.10 at 06dd724d5ea980f03a25de87a02f5d25c68addd3, Python 3.12.16 on Linux. The notebook is not executed.
import io, json
from markitdown import MarkItDown, StreamInfo
nb = {"nbformat": 4, "nbformat_minor": 5, "metadata": {}, "cells": [{
"cell_type": "markdown", "id": "example", "metadata": {},
"source": ["```python\n", "# setup comment\n", "```\n", "# Notebook title\n"],
}]}
result = MarkItDown().convert_stream(io.BytesIO(json.dumps(nb).encode("utf-8")),
stream_info=StreamInfo(extension=".ipynb"))
print(repr(result.title))
- Actual:
'setup comment' - Expected:
'Notebook title' - Control: Remove the fenced example and the current line-list path finds the correct title.
Title extraction should skip fenced code without changing the Markdown body or the explicit metadata.title override. #2762 covers string-valued source; this example uses the line-list form. #2920 concerns fences generated for code/raw cells, not fences already present in Markdown cells.
- 主要语言
- Python
- 星标
- 198k
- 派生
- 15k
- 平均合并
- 2 小时 16 分钟
- 30 天内合并 PR
- 9
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/markitdown 的其他 Issue
-
PPTX image alt text ending in a backslash breaks the Markdown image可能已有人在做 @dongyikuan919 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/markitdown#2943 ·
维护者通常 1 天内回复
-
PPTX chart labels with pipes or line breaks produce malformed Markdown tables可能已有人在做 @dongyikuan919 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 92/100
microsoft/markitdown#2937 ·
维护者通常 1 天内回复
-
DOCX: math pre-processing re-parses every document.xml even without equations (32 s -> 17.5 s on a 12.5 MB document)可能已有人在做 @houyunsun 于 26 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 89/100
microsoft/markitdown#2834 ·
维护者通常 1 天内回复
-
URL fetch sends default python-requests User-Agent, Wikipedia returns 403可能已有人在做 @sushan5140 于 31 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/markitdown#2820 ·
维护者通常 1 天内回复
-
Valid Atom feeds with zero entries are rejected as an unknown feed type可能已有人在做 @Ayush701-code-zm 于 24 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/markitdown#2781 · 1 条评论 ·
维护者通常 1 天内回复
查看 microsoft/markitdown 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choice可能已有人在做 @beartester34 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
modelscope/evalscope#2330 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Distribution plot crashes when a numeric feature is constant in the train or test set可能已有人在做 @adembilge 今天认领。 未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 10 天内回复