Skip to content

Commit

Permalink
Add full set of escape characters for LinkedIn
Browse files Browse the repository at this point in the history
  • Loading branch information
instantiator committed Nov 12, 2023
1 parent ee1c137 commit b485d62
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ public static IPostFormatter For(NetworkType network)
tagBehaviour: LengthLimitedPostFormatter.DecorationBehaviour.FirstPost,
indexBehaviour: LengthLimitedPostFormatter.IndexBehaviour.None);

// LinkedIn requires that reserved characters be escaped
// See: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/little-text-format?view=li-lms-2023-10#text
public static IPostFormatter LinkedIn => new LengthLimitedPostFormatter(
network: Network.NetworkType.LinkedIn,
limit: 3000, subsequentLimits: 1250, indices: false,
linkBehaviour: LengthLimitedPostFormatter.DecorationBehaviour.FirstPost,
breakBehaviour: LengthLimitedPostFormatter.BreakBehaviour.NewParagraph,
tagBehaviour: LengthLimitedPostFormatter.DecorationBehaviour.FirstPost,
indexBehaviour: LengthLimitedPostFormatter.IndexBehaviour.None,
escapeCharacters: new[] { '(', ')' });
escapeCharacters: "\\|{}@[]()<>#*_~".ToCharArray());

public static IPostFormatter Discord => new LengthLimitedPostFormatter(
network: Network.NetworkType.Discord,
Expand Down

0 comments on commit b485d62

Please sign in to comment.