Skip to content

Commit

Permalink
BR support.
Browse files Browse the repository at this point in the history
  • Loading branch information
cathysarisky committed Nov 4, 2024
1 parent 47cb98c commit a1e96d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/koenig-lexical/src/nodes/HeaderNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ export class HeaderNode extends BaseHeaderNode {
if (this.__headerTextEditor) {
this.__headerTextEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__headerTextEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: false, allowBr: true});
json.header = cleanedHtml;
});
}

if (this.__subheaderTextEditor) {
this.__subheaderTextEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__subheaderTextEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: false, allowBr: true});
json.subheader = cleanedHtml;
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/koenig-lexical/src/nodes/ProductNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ProductNode extends BaseProductNode {
if (this.__productTitleEditor) {
this.__productTitleEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__productTitleEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
json.productTitle = cleanedHtml;
});
}
Expand Down
6 changes: 3 additions & 3 deletions packages/koenig-lexical/src/nodes/SignupNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ export class SignupNode extends BaseSignupNode {
if (this.__disclaimerTextEditor) {
this.__disclaimerTextEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__disclaimerTextEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: false, allowBr: true});
json.disclaimer = cleanedHtml;
});
}

if (this.__headerTextEditor) {
this.__headerTextEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__headerTextEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: false, allowBr: true});
json.header = cleanedHtml;
});
}

if (this.__subheaderTextEditor) {
this.__subheaderTextEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__subheaderTextEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true, allowBr: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: tfalse, allowBr: true});
json.subheader = cleanedHtml;
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/koenig-lexical/src/nodes/ToggleNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ToggleNode extends BaseToggleNode {
if (this.__headingEditor) {
this.__headingEditor.getEditorState().read(() => {
const html = $generateHtmlFromNodes(this.__headingEditor, null);
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: true});
const cleanedHtml = cleanBasicHtml(html, {firstChildInnerContent: false, allowBr: true});
json.heading = cleanedHtml;
});
}
Expand Down

0 comments on commit a1e96d6

Please sign in to comment.