mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -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 {
|
try {
|
||||||
if (resource === 'post') {
|
if (resource === 'post') {
|
||||||
if (operation === 'create') {
|
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 shareMediaCategory = this.getNodeParameter('shareMediaCategory', i) as string;
|
||||||
const postAs = this.getNodeParameter('postAs', i) as string;
|
const postAs = this.getNodeParameter('postAs', i) as string;
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
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 authorUrn = '';
|
||||||
let visibility = 'PUBLIC';
|
let visibility = 'PUBLIC';
|
||||||
|
|
||||||
|
@ -264,7 +267,9 @@ export class LinkedIn implements INodeType {
|
||||||
delete body.title;
|
delete body.title;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Object.assign(body, { commentary: text });
|
Object.assign(body, {
|
||||||
|
commentary: text,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const endpoint = '/posts';
|
const endpoint = '/posts';
|
||||||
responseData = await linkedInApiRequest.call(this, 'POST', endpoint, body);
|
responseData = await linkedInApiRequest.call(this, 'POST', endpoint, body);
|
||||||
|
|
Loading…
Reference in a new issue