Open QuincyLarson opened 8 years ago
They work just fine for me. Could you provide a screenshot of the source code from your end @QuincyLarson @atjonathan
Out of curiosity, I've tried it too and they seem to work fine on my devices.
@Rafase282
I'm getting these errors in the console when I click on a link:
@Rafase282 I'm getting this behavior inconsistently. Seems like sometimes the links have target=blank and sometimes they don't.
How are the links transformed? Are you running a script at start to add target blank?
@BerkeleyTrue it is done on the react side. Starting on line 30.
Looks like we'll need to actually change the links or find some way to change the links during compilation.
@Rafase282 It could also be that the because that your changing the links outside of react. Then React throws away the changes and recreates the DOM.
But is was on component mount, the other way is via regex on the markdown side, the problem with that was getting a regex that would only select the link, before it was selecting more than needed and some links would get messed up or even whole paragraphs which is why I switched to the current solution.
There is an alternative, you could create a webpack plugin that would add target blank to absolute links. It might be challenge but a lot of fun and you'd learn a new skill.
Another option would be to use http://regex.inginf.units.it/ to create the regex. You'll need to feed it a lot of data but the regex it create would be pretty good.
Well the problem with the first alternative si that I change relative links to absolute ones, to get around it, I could apply the link to tab function before I convert the others to absolute links. Actually, that should be able to work just fine unless we have issues with images with links.
OK, i don't think I can fix this problem, as they open fine for me anyway now :disappointed:
As I was telling @atjonathan I think it might be an async issue, I will try to revert from converting the different parts of code into functions to have it all in nested array functions.
Unless someone with more async experience wants to chime in?
If you go to https://www.freecodecamp.com/wiki/en/localgroups-list/ and try to click on the links, you'll note that they don't open unless you open them in a new tab (command-click).