diff options
| author | Paul Buetow <paul@buetow.org> | 2024-11-05 21:59:03 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-11-05 21:59:03 +0200 |
| commit | 3551fd060242b5c0ca07d4cc371b1032d0983e38 (patch) | |
| tree | 3b31a87c9c54ce9557bd23fce557bdbe13b83ae6 /internal/platforms | |
| parent | 4e5411765c001b6e0c1cf7a038b5ad48c77092d6 (diff) | |
fix LinkedIn escapes
Diffstat (limited to 'internal/platforms')
| -rw-r--r-- | internal/platforms/linkedin/escapes.go | 2 | ||||
| -rw-r--r-- | internal/platforms/linkedin/escapes_test.go | 2 |
2 files changed, 1 insertions, 3 deletions
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) |
