-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json/prettier reformatting SyntaxError in orgmode BEGIN_SRC block #11343
Comments
In your example |
I'm testing with valid json, so with |
I'm seeing the same error if just I pipe json through |
In json-mode tell prettier the content is always to be parsed as json. Fixes formatting in orgmode `#+BEGIN_SRC json` blocks as prettier otherwise expects content as javascript. Fixes: syl20bnr#11343
I guess similar hooks need to be set for all other modes (for which prettier is added) as well as prettier needs to be told what the real format is when used in orgmode. Related: prettier/prettier-emacs#38 |
In json-mode tell prettier the content is always to be parsed as json. Fixes formatting in orgmode `#+BEGIN_SRC json` blocks as prettier otherwise expects content as javascript. Fixes: syl20bnr#11343
In json-mode tell prettier the content is always to be parsed as json. Fixes formatting in orgmode `#+BEGIN_SRC json` blocks as prettier otherwise expects content as javascript. Fixes: #11343
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Looks like #11364 fixed this issue on the develop branch. |
Thank you for posting an update. |
Description
json/prettier reformatting doesn't work in orgmode BEGIN_SRC block, instead prettier complains about "SyntaxError"
The same content when edited in a .json file reformats without problem.
Reproduction guide 🪲
BEGIN_SRC
block and press, '
(org-edit-special), =
to reformat the JSON in the bufferObserved behaviour: 👀 💔
Expected behaviour: ❤️ 😄
The buffer content is pretty-printed, something like
System Info 💻
The text was updated successfully, but these errors were encountered: