Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: html table to markdown error #1288

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"lethargy": "1.0.9",
"lodash-es": "4.17.21",
"masonic": "4.0.1",
"mdast-util-gfm-table": "^2.0.0",
"mdast-util-to-markdown": "^2.1.0",
"nanoid": "5.0.7",
"ofetch": "1.4.1",
Expand Down
3 changes: 2 additions & 1 deletion apps/renderer/src/lib/parse-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Components } from "hast-util-to-jsx-runtime"
import { toJsxRuntime } from "hast-util-to-jsx-runtime"
import { toMdast } from "hast-util-to-mdast"
import { toText } from "hast-util-to-text"
import { gfmTableToMarkdown } from "mdast-util-gfm-table"
import { toMarkdown } from "mdast-util-to-markdown"
import { createElement } from "react"
import { Fragment, jsx, jsxs } from "react/jsx-runtime"
Expand Down Expand Up @@ -237,7 +238,7 @@ export const parseHtml = (
},
}),
toText: () => toText(hastTree),
toMarkdown: () => toMarkdown(toMdast(hastTree)),
toMarkdown: () => toMarkdown(toMdast(hastTree), { extensions: [gfmTableToMarkdown()] }),
}
}

Expand Down
1 change: 0 additions & 1 deletion locales/app/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"achievement.list_subscribe_500": "500 リスト購読者",
"achievement.list_subscribe_500_description": "あなたが作成したリストの購読者数が 500 人を超えました",
"achievement.list_subscribe_50_description": "あなたが作成したリストの購読者数が 50 人を超えました",
"achievement.mint_more_power": "ハードコア プレイヤーになるとさらなる報酬を得られます <power />",
"achievement.product_hunt_vote": "Product Hunt 投票者",
"achievement.product_hunt_vote_description": "あなたは Product Hunt での Follow サポーターです",
"activation.activate": "有効化",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading