Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

refactor: Use useRenderHtmlPlugin

robin1100ec614513
diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
index 9ad324ea..6d796be4 100644
--- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
@@ -16,6 +16,7 @@ import {
import { scrollToElementTop, bgFadeOut } from '@/utils';
import { AnswerItem } from '@/common/interface';
import { acceptanceAnswer } from '@/services';
+import { useRenderHtmlPlugin } from '@/utils/pluginKit';
interface Props {
data: AnswerItem;
@@ -39,6 +40,8 @@ const Index: FC<Props> = ({
});
const [searchParams] = useSearchParams();
const answerRef = useRef<HTMLDivElement>(null);
+ useRenderHtmlPlugin(answerRef.current);
+
const acceptAnswer = () => {
acceptanceAnswer({
question_id: data.question_id,
diff --git a/ui/src/pages/Questions/EditAnswer/index.tsx b/ui/src/pages/Questions/EditAnswer/index.tsx
index 7f3e3ab2..af3b18ab 100644
--- a/ui/src/pages/Questions/EditAnswer/index.tsx
+++ b/ui/src/pages/Questions/EditAnswer/index.tsx
@@ -16,6 +16,7 @@ import {
modifyAnswer,
useQueryRevisions,
} from '@/services';
+import { useRenderHtmlPlugin } from '@/utils/pluginKit';
import './index.scss';
@@ -73,6 +74,7 @@ const Index = () => {
});
const questionContentRef = useRef<HTMLDivElement>(null);
+ useRenderHtmlPlugin(questionContentRef.current);
useEffect(() => {
if (!questionContentRef?.current) {