Skip to content

Commit da5dd25

Browse files
committed
chore: revert "fix(text-editor): close XSS vulnerability"
This reverts commit f9606ab. This revert is just here so we can add a single commit where the XSS vulnerability is fixed without introducing another bug. This makes the fix easier to backport, if necessary.
1 parent 1945268 commit da5dd25

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/components/text-editor/prosemirror-adapter/prosemirror-adapter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export class ProsemirrorAdapter {
259259
if (this.contentType === 'markdown') {
260260
this.contentConverter = new MarkdownConverter(this.customElements);
261261
} else if (this.contentType === 'html') {
262-
this.contentConverter = new HTMLConverter(this.customElements);
262+
this.contentConverter = new HTMLConverter();
263263
} else {
264264
throw new Error(
265265
`Unsupported content type: ${this.contentType}. Only 'markdown' and 'html' are supported.`,

src/components/text-editor/utils/html-converter.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
import { ContentTypeConverter } from './content-type-converter';
22
import { EditorView } from 'prosemirror-view';
3-
import { markdownToHTML } from '../../markdown/markdown-parser';
4-
import { CustomElementDefinition } from '../../../interface';
53

64
/**
75
* @private
86
*/
97
export class HTMLConverter implements ContentTypeConverter {
10-
private customNodes: CustomElementDefinition[];
11-
12-
constructor(plugins: CustomElementDefinition[]) {
13-
this.customNodes = plugins;
14-
}
15-
168
public parseAsHTML = (text: string): Promise<string> => {
17-
return markdownToHTML(text, { whitelist: this.customNodes });
9+
return new Promise((resolve) => {
10+
resolve(text);
11+
});
1812
};
1913

2014
public serialize = (view: EditorView): string => {

0 commit comments

Comments
 (0)