rimecms 0.25.13 → 0.25.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { JSONContent } from '@tiptap/core';
|
|
2
|
+
export declare const sanitizeJSONContent: (content: JSONContent) => any;
|
|
@@ -3,6 +3,10 @@ import { sanitize } from '../../util/string.js';
|
|
|
3
3
|
export const sanitizeJSONContent = (content) => {
|
|
4
4
|
if (!content)
|
|
5
5
|
return content;
|
|
6
|
+
// Prevent code mark from being sanitized (preserve original content)
|
|
7
|
+
if (Array.isArray(content.marks) && content.marks.map((m) => m.type).includes('code')) {
|
|
8
|
+
return content;
|
|
9
|
+
}
|
|
6
10
|
// Handle text nodes - sanitize the text content
|
|
7
11
|
if (content.type === 'text' && content.text) {
|
|
8
12
|
return {
|
|
@@ -11,7 +15,7 @@ export const sanitizeJSONContent = (content) => {
|
|
|
11
15
|
};
|
|
12
16
|
}
|
|
13
17
|
// Skip sanitization for code blocks (preserve original content)
|
|
14
|
-
if (content.type === 'codeBlock'
|
|
18
|
+
if (content.type === 'codeBlock') {
|
|
15
19
|
return content;
|
|
16
20
|
}
|
|
17
21
|
// Recursively handle content array
|