Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
17 lines
466 B
Markdown
17 lines
466 B
Markdown
#### Fix cursor positioning for files containing emoji (#13340 by @fisker)
|
|
|
|
```console
|
|
$ cat test.js
|
|
const { formatWithCursor } = await import("prettier");
|
|
const code = "'😀😀😀😀'";
|
|
await formatWithCursor(code, {parser: "babel", cursorOffset: 9})
|
|
|
|
# Prettier stable
|
|
$ node test.js
|
|
{ formatted: '"😀😀😀😀";\n', cursorOffset: 5, comments: [] }
|
|
|
|
# Prettier main
|
|
$ node test.js
|
|
{ formatted: '"😀😀😀😀";\n', cursorOffset: 9, comments: [] }
|
|
```
|