From 3551fd060242b5c0ca07d4cc371b1032d0983e38 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 5 Nov 2024 21:59:03 +0200 Subject: fix LinkedIn escapes --- internal/platforms/linkedin/escapes.go | 2 -- internal/platforms/linkedin/escapes_test.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'internal/platforms/linkedin') diff --git a/internal/platforms/linkedin/escapes.go b/internal/platforms/linkedin/escapes.go index 9ab3077..5e431c7 100644 --- a/internal/platforms/linkedin/escapes.go +++ b/internal/platforms/linkedin/escapes.go @@ -8,9 +8,7 @@ import ( func escapeLinkedInText(input string) string { var builder strings.Builder - // TODO: '"' escapes don't work correctly yet, they show up as \"...\" in LinkedIn posts reservedChars := map[rune]string{ - '"': "\\\"", // Just remove this line to fix the above? '|': "\\|", '{': "\\{", '}': "\\}", diff --git a/internal/platforms/linkedin/escapes_test.go b/internal/platforms/linkedin/escapes_test.go index b1f9203..946125e 100644 --- a/internal/platforms/linkedin/escapes_test.go +++ b/internal/platforms/linkedin/escapes_test.go @@ -7,7 +7,7 @@ import ( func TestLinkedInEscapes(t *testing.T) { var ( input = `This is a test message with special characters: " {} @ [] () <> # \ * _ ~ |` - expected = `This is a test message with special characters: \" \{\} @ \[\] \(\) \<\> # \\ \* \_ \~ \|` + expected = `This is a test message with special characters: " \{\} @ \[\] \(\) \<\> # \\ \* \_ \~ \|` ) if escaped := escapeLinkedInText(input); escaped != expected { t.Errorf("expected '%s' but got '%s'", expected, escaped) -- cgit v1.2.3