Skip to content

Getting wrong output form input of any username with a trailing underscore #206

Open

Description

@c12i

Description
When inputting usernames (Twitter, Github, Linkedin or Patreon) with a trailing underscore (i.e foo_), a backward slash is inserted before the trailing underscore leading to errors loading the badge correctly and having to manually fix it.

To Reproduce
Steps to reproduce the behavior:
Input:

GitHub username (use empty value to skip) foo_

Output

GitHub username (use empty value to skip) foo\_
  1. Run npx readme-md-generator
  2. Skip to username input part
  3. When asked to input Github username, key in foo_
  4. See error

ScreenShot
Screenshot 2020-04-16 at 12 35 54

Desktop:

  • OS: [MacOS Catalina]
  • Version [10.15.3]

Activity

  1. jeremiahtenbrink commented on Jun 25, 2020

    @jeremiahtenbrink

    I am getting wrong username values for my username at twitter.
    Pretty sure its happening because of the escapeMarkdown function that is being called in cleanSocialNetworkUsername function.

  2. c12i commented on Jun 26, 2020

    @c12i
    Author

    Yes indeed @jeremiahtenbrink , the error seems to be originating from the markdownEscape library. Removing the _ replacement seems to fix the issue.
    Screenshot 2020-06-26 at 10 21 43

  3. jeremiahtenbrink commented on Jun 26, 2020

    @jeremiahtenbrink

    Interesting. Is that an option we get with that package. I'm not entirely sure why we are escaping markdown text anyway. It's not we are having to worry about other users injecting code into our readme. We aren't parsing users text and turning it into a readme. So why we are trying to escape the text I don't understand. If anyone has more insight and its something I'm missing. Please let me know.

  4. c12i commented on Jun 26, 2020

    @c12i
    Author

    Perhaps @anku255 could have a good reason for that, see his pr #183

  5. Edo78 commented on Oct 21, 2020

    @Edo78

    I think I understood what's happening... Let's me explain but keep in mind that English isn't my first language so bear with me.

    My Twitter username is _Edo_ so it must be escaped otherwise in markdown is showed as Edo (without the underscore and in italic).

    The problem arise only using HTML because the URL is still escaped for markdown even if it's not parsed as markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions