feat: add Nemeth braille math support to markdown processor#26
Merged
feat: add Nemeth braille math support to markdown processor#26
Conversation
jamliaoo
commented
Mar 24, 2026
Comment on lines
21
to
+23
| math: PropTypes.string, | ||
| typed: PropTypes.oneOf(['latex', 'asciimath']), | ||
| typed: PropTypes.oneOf(['latex', 'asciimath', 'nemeth']), | ||
| latex: PropTypes.string, |
Contributor
Author
There was a problem hiding this comment.
如果 props 命名容易混淆的話也可以再討論~不過 math 要改的話可能有 breaking change
- math 存原始輸入,格式取決於 typed
- latex 只有 nemeth 情境才有值,因為點字需要先轉成 LaTeX 作為中間格式,保留下來方便下游使用(例如 Access8MathWeb 拿來做其他處理)
| prop | typed: 'latex' |
typed: 'asciimath' |
typed: 'nemeth' |
|---|---|---|---|
math |
LaTeX 原始字串,e.g. a+b=c |
AsciiMath 原始字串,e.g. a+b=c |
Nemeth 點字原始字串,e.g. ⠁⠘⠆ |
latex |
未傳入(undefined) |
未傳入(undefined) |
轉換後的 LaTeX,e.g. a^2 |
jamliaoo
commented
Mar 24, 2026
| "rollup": "^4.40.1" | ||
| }, | ||
| "dependencies": { | ||
| "@coseeing/nemeth2latex": "^0.1.0", |
Contributor
Author
There was a problem hiding this comment.
尚未發布 npm,local 目前用 npm link 做測試
wendyyuchensun
approved these changes
Mar 24, 2026
…port * Integrated a new Nemeth extension into the markdown processor to handle braille math syntax. * Updated the processor's configuration to include the Nemeth extension, improving support for mathematical content in braille format. * Enhanced the rendering capabilities for Nemeth tokens, ensuring proper conversion to LaTeX, MathML, and SVG outputs.
* Added a new test case to validate the handling of Nemeth braille math expressions in the markdown processor. * Updated snapshot tests to ensure accurate rendering and metadata extraction for Nemeth math expressions. * Improved overall test coverage for mathematical content processing in braille format.
cedbade to
94dd27a
Compare
Contributor
Author
|
後續更新
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景描述 (Why)
SeeMark 目前支援 LaTeX 和 AsciiMath 的數學渲染,新增 Nemeth 點字(braille)編寫的數學式。
實作方法 (How)
新增一個
nemethmarked extension,使用@⠀...⠀@語法(@符號夾住 Unicode U+2800–U+28FF 點字字元)識別 Nemeth 數學區塊。轉換流程:
@coseeing/nemeth2latex)latex2mml)mml2svg)渲染結果整合進現有的
Math組件,typed欄位標記為'nemeth',同時保留原始點字內容 (math) 及轉換後的 LaTeX (latex)。實際變更
@coseeing/nemeth2latex依賴src/markdown-processor/marked-extentions/nemeth.js— Nemeth marked extensionmarkdown-processor.js中註冊 nemeth extensionMath.jsxPropTypes,新增latex欄位及'nemeth'typed 選項測試驗證
@⠁⠘⠆@(點字a²)可正確解析,typed === 'nemeth',latex === 'a^2'補充說明
@⠀...⠀@包裹,其中第一個@後緊跟點字字元,與既有的@[、@!語法不衝突latexprop 為新增欄位,供 consumer(如 Access8MathWeb)存取轉換後的 LaTeX 原始碼@coseeing/nemeth2latex尚未發布至 npm,目前以npm link在本地測試。正式合併前需先發布該套件並更新package.json中的版本號相關連結
@coseeing/nemeth2latex