Numeric character references: Should HTML spec be followed for codes mapping to control characters
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- html, markdown
调研方向
Read the decimal numeric character references section in the CommonMark specification, then compare its stated behavior with the HTML numeric character reference rules and the linked commonmark.js and cmark implementations. The work is done when the project agrees whether the HTML replacement table is required or optional and the specification wording reflects that decision.
由索引模型根据 Issue 内容生成。
描述
The spec says this:
Decimal numeric character references consist of
&#+ a string of 1--7 arabic digits +;.
A numeric character reference is parsed as the corresponding Unicode character.
Invalid Unicode code points will be replaced by the REPLACEMENT CHARACTER (U+FFFD).
For security reasons, the code pointU+0000will also be replaced byU+FFFD.
But note that commonmark.js doesn't actually follow that. Take – for example. In hex 150 is 96 which would map to U+0096, which is the (SPA) control character. However, it is converted to an en-dash –, see dingus.
The reason for this is that commonmark.js uses the entities package which implements the HTML spec. The HTML spec has a replacement table for certain characters, see parsing section:
If the number is one of the numbers in the first column of the following table, then find the row with that number in the first column, and set the character reference code to the number in the second column of that row.
Number Code point ... ... 0x96 0x2013 EN DASH (–) ... ...
(cmark behaves differently yet again, for certain code points, it uses a replacement character instead.)
Question: Should the spec prescribe the same mapping as the HTML spec? Or should it mention it and make it optional whether an implementation uses the replacement table or not?
(Originally raised here: https://github.com/commonmark/commonmark-java/issues/307#issuecomment-1974796674)
- 主要语言
- Python
- 星标
- 5.2k
- 派生
- 361
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
commonmark/commonmark-spec 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
commonmark/commonmark-spec#843 ·
-
难度 1/5 1 小时以内 新手友好度 68/100
commonmark/commonmark-spec#838 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 62/100
commonmark/commonmark-spec#728 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
commonmark/commonmark-spec#848 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
commonmark/commonmark-spec#844 · 5 条评论 · 1 个 reaction ·
查看 commonmark/commonmark-spec 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
With emit_ontology_keys, one ontology key change is reported as two errors (keys and keys_digest)可能已有人在做 @rvandewater 今天认领。 未关闭bug priority:low
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 1/5 1-3 小时 新手友好度 84/100
iausathub/satchecker#286 ·
维护者通常 1 天内回复
-
bug test
难度 2/5 1-3 小时 新手友好度 82/100
OpenAssetIO/OpenAssetIO#1527 ·
-
automated endpoint-dead needs-curation
难度 2/5 1-3 小时 新手友好度 72/100
almanac-data/climate-almanac#128 ·
维护者通常 1 天内回复