Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Failing on certain usernames #12

Closed
zslabs opened this issue Mar 21, 2019 · 2 comments · Fixed by #13
Closed

Failing on certain usernames #12

zslabs opened this issue Mar 21, 2019 · 2 comments · Fixed by #13

Comments

@zslabs
Copy link

zslabs commented Mar 21, 2019

👋 Thanks for creating this! I'm getting some pretty weird results that just aren't adding up. I've checked the regex used in this library against a link like https://twitter.com/Ana_M_Medina/status/1045730232743813121 (which it does correctly match), but when the library is actually performing the swaps, I noticed the debug and eventual widget output doesn't include it. It looks like it may have something to do with the multiple underscores in the username, but the regex seemed to correctly handle it, so I'm a bit 🤷‍♂️ on what's up here. Any thoughts would be greatly appreciated. Thanks!

cc @isaacs

@isaacs
Copy link
Contributor

isaacs commented Mar 22, 2019

Yeah, what's happening is that it's converting the _M_ into <em>M</em> because the _ is getting markdowned.

@zslabs
Copy link
Author

zslabs commented Mar 22, 2019

Ah interesting! Yep - you're 100% right. One thing I liked about https://www.gatsbyjs.org/packages/gatsby-remark-embed-video/ was being a bit more explicit with defining a video service provider, but I wonder if we'd run into a similar issue there if a video ID had an ID that matched something similar to what you mentioned; since this may be running too late in the remark chain.

isaacs added a commit to isaacs/gatsby-remark-twitter that referenced this issue Mar 22, 2019
jmolivas pushed a commit that referenced this issue Mar 26, 2019
* Flatten out _ chars when comparing to url

Fix #12

* Test with non-flattenable emphasis

Get to 100% coverage

* Remove unused babel-cli, update tap to faster v13

This removes the vulnerable dep on braces, since babel-cli isn't
actually used directly anywhere in this module anyway.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants