Skip to content

Commit

Permalink
fix #19 (#20)
Browse files Browse the repository at this point in the history
* fix #19

* Update packages/babel-plugin-open-source/babel.js

remove cooked and tail. Thanks!!!

Co-authored-by: Siddharth Kshetrapal <[email protected]>

Co-authored-by: Siddharth Kshetrapal <[email protected]>
  • Loading branch information
alt1o and siddharthkp authored Apr 14, 2022
1 parent d04ec91 commit 985fc39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-plugin-open-source/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ module.exports = declare((api) => {
url = `vscode://file/${state.filename}:${location.start.line}`;
}
const sourceData = JSON.stringify({ url });
const sourceNode = t.jsxExpressionContainer(t.templateLiteral([t.templateElement({ raw: sourceData })], []))

path.container.openingElement.attributes.push(
t.jsxAttribute(t.jsxIdentifier('data-source'), t.stringLiteral(sourceData))
t.jsxAttribute(t.jsxIdentifier('data-source'), sourceNode)
);
}
};
Expand Down

1 comment on commit 985fc39

@vercel
Copy link

@vercel vercel bot commented on 985fc39 Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.