-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Describe the bug
TenTap editor strips whitespace between HTML nodes when setting content via initialContent or setContent. This causes formatting issues where intended spacing between inline elements is lost.
Expected behavior
When setting HTML content like "<a href='hello'>hello</a> <a href='world'>world</a>", the two spaces between the anchor tags should be preserved in the editor.
Actual behavior
The whitespace between HTML nodes is stripped, resulting in "<a href='hello'>hello</a><a href='world'>world</a>" (no spaces between links).
To Reproduce
import { useEditorBridge, RichText, CoreBridge } from '@10play/tentap-editor';
const TestEditor = () => {
const editor = useEditorBridge({
bridgeExtensions: [CoreBridge],
initialContent: "<a href='hello'>hello</a> <a href='world'>world</a>",
});
return <RichText editor={editor} />;
};Test cases that fail:
- Inline elements with spaces:
"<a href='hello'>hello</a> <a href='world'>world</a>" - Multiple spaces in text:
"<span>Text with multiple spaces</span>"
Metadata
Metadata
Assignees
Labels
No labels