Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
bespoyasov committed Nov 4, 2023
1 parent 0c0349b commit 0a54e26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 6 additions & 1 deletion components/Code/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export class Code extends PureComponent<PropsWithChildren<CodeProps>> {

highlight = (source: string) => {
const { lang } = this.props
return rehype().stringify(refractor.highlight(source, lang)).toString()
return (
rehype()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.stringify(refractor.highlight(source, lang) as any)
.toString()
)
}

createCodeElement = (innerHtml: string) => {
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@
"unist-util-is": "^6.0.0",
"yaspeller": "^9.1.0"
},
"peerDependencies": {
"fsevents": ">=1.2.9"
},
"engines": {
"node": ">=16"
"node": ">=18"
}
}
6 changes: 3 additions & 3 deletions services/BookBuilder/mdAstTree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import remarkMdx, { Root } from 'remark-mdx'
import remarkMdx from 'remark-mdx'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkToc from 'remark-toc'
Expand All @@ -7,11 +7,11 @@ import { unified } from 'unified'
import { Markdown } from './markdown'

export abstract class MdAstTreeAdapter {
public static parse = (markdown: Markdown): Root => {
public static parse = (markdown: Markdown) => {
return unified().use(remarkParse).use(remarkMdx).parse(markdown.content)
}

public static stringify = (astTree: Root): string => {
public static stringify = (astTree): string => {
return unified().use(remarkStringify).use(remarkMdx).stringify(astTree)
}

Expand Down

1 comment on commit 0a54e26

@vercel
Copy link

@vercel vercel bot commented on 0a54e26 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.