Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/toRedactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const ELEMENT_TYPES: IJsonToHtmlElementTags = {
return `<div${attrs}>${child}</div>`
},
hr: (attrs: any, child: any) => {
return `<div data-type='hr' style='border-top: 3px solid #bbb'></div>`
return `<hr>`
},
span: (attrs: any, child: any) => {
return `<span${attrs}>${child}</span>`
Expand Down
3 changes: 2 additions & 1 deletion test/expectedJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export default {
"htmlUpdated": "<p></p><img asset_uid=\"blt5523ee02703e39f5\" src=\"https://images.com/captain_pardip.jpg\" width=\"24.193548387096776\" height=\"auto\" style=\"width: 24.193548387096776; height: auto;height: auto;\" type=\"asset\" sys-style-type=\"download\"/><p></p><iframe src=\"https://www.***REMOVED***.com/embed/CSvFpBOe8eY\"></iframe><img asset_uid=\"blta2aad0332073026c\" src=\"https://images.com/logo_1.jpg\" height=\"auto\" type=\"asset\" sys-style-type=\"download\"/>"
},
"7": {
"html": "<p>this is <a href=\"link.com\" target=\"_self\">link</a></p><p></p><div data-type='hr' style='border-top: 3px solid #bbb'></div><p></p><p class=\"className\">paragraph with class</p><p id=\"id\">paragraph with id</p>",
"html": "<p>this is <a href=\"link.com\" target=\"_self\">link</a></p><p></p><hr><p></p><p class=\"className\">paragraph with class</p><p id=\"id\">paragraph with id</p>",
"json": [
{
"type": "p",
Expand Down Expand Up @@ -660,6 +660,7 @@ export default {
},
{
"type": "hr",
"attrs": {},
"uid": "699946dbb6b84ef583914eb92dcac44b",
"children": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/fromRedactor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("Testing html to json conversion", () => {
let htmlDoc = dom.window.document.querySelector('body')
let jsonValue = fromRedactor(htmlDoc)
let testResult = isEqual(omitdeep(jsonValue, "uid"), omitdeep(docWrapper(expectedValue[7].json), "uid"))
expect(testResult).toBe(true)
expect(omitdeep(jsonValue, "uid")).toStrictEqual(omitdeep(docWrapper(expectedValue[7].json), "uid"))
})

it("Embedded entry as link", () => {
Expand Down
Loading