fix: update rehype-remark (#3864)
This commit is contained in:
@ -29,7 +29,7 @@
|
||||
"react-monaco-editor": "^0.25.1",
|
||||
"react-select": "^2.4.3",
|
||||
"rehype-parse": "^6.0.0",
|
||||
"rehype-remark": "^5.0.1",
|
||||
"rehype-remark": "^8.0.0",
|
||||
"rehype-stringify": "^7.0.0",
|
||||
"remark-parse": "^6.0.3",
|
||||
"remark-rehype": "^4.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { markdownToSlate } from '../';
|
||||
import { markdownToSlate, htmlToSlate } from '../';
|
||||
|
||||
describe('markdownToSlate', () => {
|
||||
it('should not add duplicate identical marks under the same node (GitHub Issue 3280)', () => {
|
||||
@ -41,3 +41,25 @@ describe('markdownToSlate', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('htmlToSlate', () => {
|
||||
it('should preserve spaces in rich html (GitHub Issue 3727)', () => {
|
||||
const html = `<strong>Bold Text</strong><span><span> </span>regular text<span> </span></span>`;
|
||||
|
||||
const actual = htmlToSlate(html);
|
||||
expect(actual).toEqual({
|
||||
object: 'block',
|
||||
type: 'root',
|
||||
nodes: [
|
||||
{
|
||||
object: 'block',
|
||||
type: 'paragraph',
|
||||
nodes: [
|
||||
{ object: 'text', text: 'Bold Text', marks: [{ type: 'bold' }] },
|
||||
{ object: 'text', text: ' regular text' },
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user