mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Ghost Node): Add support for lexical format (#7488)
This commit is contained in:
@@ -195,6 +195,14 @@ export class Ghost implements INodeType {
|
||||
if (contentFormat === 'html') {
|
||||
post.html = content;
|
||||
qs.source = 'html';
|
||||
} else if (contentFormat === 'lexical') {
|
||||
const lexical = validateJSON(content);
|
||||
if (lexical === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'Content must be a valid JSON', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
post.lexical = content;
|
||||
} else {
|
||||
const mobileDoc = validateJSON(content);
|
||||
if (mobileDoc === undefined) {
|
||||
@@ -293,6 +301,15 @@ export class Ghost implements INodeType {
|
||||
post.html = updateFields.content || '';
|
||||
qs.source = 'html';
|
||||
delete updateFields.content;
|
||||
} else if (contentFormat === 'lexical') {
|
||||
const lexical = validateJSON((updateFields.contentJson as string) || undefined);
|
||||
if (lexical === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'Content must be a valid JSON', {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
post.lexical = updateFields.contentJson;
|
||||
delete updateFields.contentJson;
|
||||
} else {
|
||||
const mobileDoc = validateJSON((updateFields.contentJson as string) || undefined);
|
||||
if (mobileDoc === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user