mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(LinkedIn Node): Fix issue with some characters cutting off posts early (#10185)
This commit is contained in:
parent
f5722e8823
commit
361b5e7c37
|
@ -121,11 +121,14 @@ export class LinkedIn implements INodeType {
|
|||
try {
|
||||
if (resource === 'post') {
|
||||
if (operation === 'create') {
|
||||
const text = this.getNodeParameter('text', i) as string;
|
||||
let text = this.getNodeParameter('text', i) as string;
|
||||
const shareMediaCategory = this.getNodeParameter('shareMediaCategory', i) as string;
|
||||
const postAs = this.getNodeParameter('postAs', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
// LinkedIn uses "little text" https://learn.microsoft.com/en-us/linkedin/marketing/community-management/shares/little-text-format?view=li-lms-2024-06
|
||||
text = text.replace(/[\(*\)\[\]\{\}<>@|~_]/gm, (char) => '\\' + char);
|
||||
|
||||
let authorUrn = '';
|
||||
let visibility = 'PUBLIC';
|
||||
|
||||
|
@ -264,7 +267,9 @@ export class LinkedIn implements INodeType {
|
|||
delete body.title;
|
||||
}
|
||||
} else {
|
||||
Object.assign(body, { commentary: text });
|
||||
Object.assign(body, {
|
||||
commentary: text,
|
||||
});
|
||||
}
|
||||
const endpoint = '/posts';
|
||||
responseData = await linkedInApiRequest.call(this, 'POST', endpoint, body);
|
||||
|
|
Loading…
Reference in a new issue