Skip to content

Escape chars for elixir v1.19 compat#620

Open
naserca wants to merge 1 commit into
elixirs:devfrom
naserca:escape-chars-for-v1.19
Open

Escape chars for elixir v1.19 compat#620
naserca wants to merge 1 commit into
elixirs:devfrom
naserca:escape-chars-for-v1.19

Conversation

@naserca

@naserca naserca commented Sep 29, 2025

Copy link
Copy Markdown

In the v1.19 branch (specifically) of elixir-lang, these chars cause a SyntaxError:

== Compilation error in file lib/faker/string.ex ==
** (SyntaxError) invalid syntax found on lib/faker/string.ex:217:16:
     error: invalid line break character in string: \u2029. If you want to use such character, use it in its escaped \u2029 form instead
     │
 217 │     "\u2029test
",
     │                ^
     │
     └─ lib/faker/string.ex:217:16
    (elixir 1.19.0-rc.0) lib/kernel/parallel_compiler.ex:480: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8

This PR escapes them without other changes.

seantanly added a commit to yojee/faker that referenced this pull request Oct 20, 2025
zekedou added a commit to ever-forge/fake that referenced this pull request Oct 22, 2025
@ypconstante

Copy link
Copy Markdown
Contributor

This is now an error with Elixir 1.20-rc

4> == Compilation error in file lib/faker/string.ex ==
4> ** (SyntaxError) invalid syntax found on lib/faker/string.ex:143:31:
4>      error: invalid line break character in string: \u2028. If you want to use such character, use it in its escaped \u2028 form instead
4>      │
4>  143 │     "\t\u000b\f�             ​

   ",
4>      │                               ^
4>      │
4>      └─ lib/faker/string.ex:143:31
4>     (elixir 1.20.0-rc.0) lib/kernel/parallel_compiler.ex:529: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
4> could not compile dependency :faker, "mix compile" failed.

@rodrigues rodrigues left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes the issue for me in elixir 1.20

@rodrigues

rodrigues commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

cc @vbrazo @igas @anthonator

seantanly added a commit to yojee/faker that referenced this pull request Apr 12, 2026
dkarter pushed a commit to pdqcom/faker that referenced this pull request Jun 4, 2026
Elixir 1.19+ (and 1.20) raises a SyntaxError for literal line/paragraph
separator characters (U+2028, U+2029) inside strings. Replace them with
their 
/
 escape sequences in Faker.String.naughty/0.

Matches upstream fix: elixirs#620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants