Add topic extension
This commit is contained in:
+2
-18
@@ -1,20 +1,4 @@
|
||||
import type {JSONContent} from '@tiptap/core'
|
||||
|
||||
export * from '@lib/tiptap/util'
|
||||
export {createSuggestions} from '@lib/tiptap/Suggestions'
|
||||
export {TopicExtension} from '@lib/tiptap/TopicExtension'
|
||||
export {LinkExtension} from '@lib/tiptap/LinkExtension'
|
||||
|
||||
export const findNodes = (json: JSONContent, type: string) => {
|
||||
const results: JSONContent[] = []
|
||||
|
||||
for (const node of json.content || []) {
|
||||
if (node.type === type) {
|
||||
results.push(node)
|
||||
}
|
||||
|
||||
for (const result of findNodes(node, type)) {
|
||||
results.push(result)
|
||||
}
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user