Begin refactoring AI module (#12464)

Cleaning up to prepare for a few tests
This commit is contained in:
Félix Malfait
2025-06-05 12:28:42 +02:00
committed by GitHub
parent a67435f840
commit b481abbb0f
36 changed files with 3191 additions and 1383 deletions

View File

@ -4,7 +4,7 @@ import React, { useEffect, useState } from 'react';
import rehypeStringify from 'rehype-stringify';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import { unified } from 'unified';
import { PluggableList, unified } from 'unified';
import { visit } from 'unist-util-visit';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
@ -89,9 +89,7 @@ export const Releases = () => {
for (const release of json) {
release.html = String(
await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeStringify)
.use([remarkParse, remarkRehype, rehypeStringify] as PluggableList)
.use(() => (tree: any) => {
visit(tree, (node) => {
if (node.tagName === 'h1' || node.tagName === 'h2') {