Skip to content

Commit

Permalink
fix: avoid internal import
Browse files Browse the repository at this point in the history
Fixes #466
  • Loading branch information
petyosi committed May 22, 2024
1 parent eb103b6 commit c38a2d7
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/mdastUtilHtmlComment.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// typed version of https://github.com/slorber/remark-comment/blob/slorber/multiline-comment-bug/index.js
import type { Config } from 'mdast-util-from-markdown/lib'
//
import type { Handle, Transform } from 'mdast-util-from-markdown'
import { factorySpace } from 'micromark-factory-space'
import { markdownLineEnding } from 'micromark-util-character'
import { types, codes } from 'micromark-util-symbol'
import { codes, types } from 'micromark-util-symbol'

import type { Code, Extension, Tokenizer } from 'micromark-util-types'

Expand All @@ -14,6 +15,26 @@ declare module 'micromark-util-types' {
}
}

// https://github.com/syntax-tree/mdast-util-from-markdown/blob/main/dev/index.d.ts
interface Config {
/**
* Token types where line endings are used.
*/
canContainEols: string[]
/**
* Opening handles.
*/
enter: Record<string, Handle>
/**
* Closing handles.
*/
exit: Record<string, Handle>
/**
* Tree transforms.
*/
transforms: Transform[]
}

export function commentFromMarkdown(_options: { ast?: boolean }): Partial<Config> {
return {
canContainEols: ['comment'],
Expand Down

0 comments on commit c38a2d7

Please sign in to comment.