Skip to content

Commit

Permalink
Merge pull request #264 from xen0n/fix-natlang-plugin
Browse files Browse the repository at this point in the history
Fix natlang plugin
  • Loading branch information
xen0n authored Dec 22, 2024
2 parents 7ad21c2 + ef8bed4 commit f5fe669
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 119 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"@easyops-cn/docusaurus-search-local": "^0.46.1",
"@jsdevtools/rehype-url-inspector": "^2.0.2",
"@mdx-js/react": "^3.1.0",
"antd": "^5.22.3",
"antd": "^5.22.5",
"browserslist": "^4.24.3",
"clsx": "^2.1.1",
"glob": "^11.0.0",
"lodash": "^4.17.21",
"mdast-util-find-and-replace": "^3.0.1",
"prism-react-renderer": "^2.4.0",
"prism-react-renderer": "^2.4.1",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/awly-remark-natlang-usage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Nodes, PhrasingContent } from 'mdast'
// import { findAndReplace } from 'mdast-util-find-and-replace'
import { findAndReplace } from 'mdast-util-find-and-replace'

function produceErhuaMark(): PhrasingContent {
// this won't work
Expand All @@ -16,8 +16,7 @@ function produceErhuaMark(): PhrasingContent {
}
}

export default async function plugin() {
const { findAndReplace } = await import('mdast-util-find-and-replace')
export default function plugin() {
return (tree: Nodes) => {
findAndReplace(tree, [
[':儿:', produceErhuaMark],
Expand Down
Loading

0 comments on commit f5fe669

Please sign in to comment.