Skip to content

escape single quote in jsx #293

Description

It is acting weird when you have a backslash + single quote in jsx.
`


{'test'test'}

`

Activity

  1. prettydiff commented on Apr 4, 2016

    @prettydiff
    Owner

    I found the problem is https://github.com/prettydiff/prettydiff/blob/master/lib/markuppretty.js#L1035

    } else if (b[a] === quote.charAt(quote.length - 1)) {
    

    Needs to become

    } else if (b[a] === quote.charAt(quote.length - 1) && ((global.jsxstatus === true && end === "}" && b[a - 1] !== "\\") || global.jsxstatus === false || end !== "}")) {
    

    The markup parser wasn't smart enough to account for escaped quotes of JavaScript fragments of JSX. I will release this fix with version 2, which I am trying to wrap up as rapidly as possible.

  2. added this to the V2.0.0 milestone on Apr 4, 2016
  3. prettydiff commented on Apr 21, 2016

    @prettydiff
    Owner

    Fixed with the 2.0.0 release

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions