atom-react
atom-react copied to clipboard
An apostrophe breaks syntax highlighting
Looks like the grammar thinks it's a Javascript string even when it's in the JSX part of the file:
Sorry for the delay! Published a new version and it should be fixed now. Feel free to reopen if the problem persists.
:smiley:
Looks like there's still an issue. This is 0.12.10.
Still an issue on Atom 1.2.4 and atom-react 0.12.10
also, text inside JSX elements gets keyword highlighting:
@dmnd can you reopen this issue please?
:+1:
I can't find how to reopen, so I just created #124.
This is still an issue. Is anyone working on the problem?
It seems to regress often. Whoever fixes it should try to add a regression test too. On Wed, Apr 20, 2016 at 10:33 Jessie Richardson [email protected] wrote:
This is still an issue. Is anyone working on the problem? [image: screen shot 2016-04-20 at 1 32 21 pm] https://cloud.githubusercontent.com/assets/9681896/14684142/69cb5666-06fc-11e6-8503-a06bdf8936b4.png
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/orktes/atom-react/issues/3#issuecomment-212527752
I've noticed that adding a .
on the same line before the apostrophe is sometimes responsible for triggering this.
I also have this problem
I have this problem right now too - despite an escape even
I am having this issue too so I've decided against using apostrophes. I just hope the grammar police don't come calling.
Any update on this?
Running into this issue as well, I am coerced into foregoing apostrophes :( Any updates?
The struggle is still real. Any ideas?
Same issue in my project
if i use this ’, instead of this ' it works. Not sure if it's grammatically right and allowed.
Same issue here
Same issue for me.
A temporary work around is to use '
instead of '.
I'm having this issue too.
Workaround: put the text in a JavaScript var
and insert it into JSX with the {}
notation:
render() {
const title = "Don't worry, be happy!";
return (
<div>
<h1>{title}</h1>
</div>
);
}
This is really bothersome :(
Yes, this is a sad limitation (FOR SUCH A GREAT EDITOR), makes a component almost unusable any time we need someone's stuff to have an apostrophe :-(
decorative apostrophe ftw
Dirty workaround : use '
entity 👎
More workarounds with backticks or double quotes:
<span>
I{`'`}m a workaround. Let{"'"}s get some frosty chocolate milkshakes!
</span>
<span>
{`Or y'all can just wrap text like this. It's not ideal, but it'll do.`}
</span>
I have the same problem, any updates?
I'm having the same issue as @kengres.
Sames. Question mark also causes a problem - doesn't error-highlight subsequent text but stops syntax highlighting
same as @kengres.
I have been working around the issue by adding a double apostrophe or double single quotes
Rest of team uses WebStorm and (understandably) don't want workarounds for atom-react in the code. Can we get word on if you guys have seen this issue and if its being prioritised? thanks
@proftom @srinath-ragh @justinzelinsky I've installed a package called language-babel and the issue is gone...
related issue... https://github.com/orktes/atom-react/issues/212 Also looks like language-babel is no longer supported. Wish I had some free time to help with a fix!
I'm hitting this bug as well. It was first reported two and a half years ago!
In the meantime I'm working around it by doing this {"'"} when I need a single parenthesis.
I'm encountering this as well. I hoped this gets resolved soon. @OriginalPenguin's workaround is ingenious, so thanks for that!
This was a problem for me, too. Then I switched the language to JavaScript (JSX) and it started working. The only remaining problem is that syntax highlighting still breaks when the apostrophe isn't followed by another character. So something like dogs' would not work.
Actually, a co-worker discovered the language-babel plugin handles the trailing apostrophe as well.
Still not working...
Issue is still around in 2017
Switch to language-babel ... much nicer On Fri, 20 Jan 2017 at 1:13 pm, Charles Moyes [email protected] wrote:
Issue is still around in 2017
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/orktes/atom-react/issues/3#issuecomment-273958233, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcs8rHjaklZYH_mYN1ekLmvpSnUdTXfks5rUBgygaJpZM4CH72o .
@orktes Any updates to this?
language-babel is the way to go, thanks for the recommendation
How is this a thing?
I would suggest installing language-bable package.
Why does this issue still exist...? just ran into it...
Good, it's not just me. Was really annoying. Installing Language-babel solved the issue.
I believe this post on Stack Overflow should help. https://stackoverflow.com/q/32979512
...
return (
<div>
<p>{"I've seen the movie."}</p>
</div>
)
...
@orktes I guess you can close this one. As @kengres mentioned long ago there is a solution for this. Installing language-babel on current 1.18.0 version (and assume that also on others) fixes the issue
Is there a reason to use this project in 2017? All features from atom-react are native in Atom except the code snippets.
@NathanCH Atom doesn't include proper indentation support (nested tags and attributes), highlighting and tag auto completion by default.
language-babel solves this issue
Our workaround is to use '
@kengres 's methods really work. don't waste time guys
this code is usefull for me. you can use it as follow :
<p>Let{"'"}s start by getting to know your business...</p>
I installed language-babel and it resolved the issue for me.
https://atom.io/packages/language-babel\
restart Atom after install.
use different class like Constant.js
declare your text there:
export const TEXT = 'Didn`t find what you want?';
and in your app.js use like this
import { TEXT } from '../Constants';
<Text>{TEXT}</Text>
Another workaround:
{'We won\'t do anything with you email. It\'s just to prevent spam.'}
A bit cleaner than the others suggested.
Just downloaded Atom yesterday and this is an issue for me as well :(
Follow @nseller's suggestion
https://github.com/orktes/atom-react/issues/3#issuecomment-371200678
Thanks! That worked wonders! :)
language-babel
Additional not breaking style alternative: https://atom.io/packages/react
nseller's comment worked but I had to uninstall atom-react.
language-babel worked, and I didn't have to uninstall atom-react OR restart Atom. Cool!
I uninstalled atom-react and installed language-babel, and I'm still having this issue with both, even after uninstalling.
Edit: Looks like it works as long as I don't use the shorthand syntax and still include the parenthesis in the return: