We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CIでもチェックしたい
The text was updated successfully, but these errors were encountered:
MarkdownのASTを参照するのが楽そうですね vitepressが使っているmarkdown-itを使うなら、MarkdownIt.prototype.parseでよさそう?(ASTのドキュメントが無いですが)
MarkdownIt.prototype.parse
Sorry, something went wrong.
vitepressが独自記法のプラグインなどを含んだmarkdown-itのインスタンスを返す関数をexportしているようなので、これが使えますね。 fenceがコードブロックで1、.infoに言語名(0行目?)が入るようです。
.info
import { createMarkdownRenderer } from "vitepress"; const md = await createMarkdownRenderer(); const tokens = md.parse(markdownText, {}); const codes = tokens .filter(token => token.type === "fence" && (token.info === "ais" || token.info === "aiscript")) .map(token => token.content);
https://spec.commonmark.org/0.31.2/#fenced-code-blocks ↩
takejohn
No branches or pull requests
CIでもチェックしたい
The text was updated successfully, but these errors were encountered: