Skip to content

Commit

Permalink
refactor(ui-docs-client): fix Codepen button
Browse files Browse the repository at this point in the history
there was some undocumented change that broke it
  • Loading branch information
matyasf committed Feb 4, 2022
1 parent 20986c7 commit a518182
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/ui-docs-client/src/CodePenButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ class CodePenButton extends Component {
private: true,
editors: '001',
html: '<div id="app"></div><div id="flash-messages"></div><div id="nav"></div>',
layout: 'top',
css_prefix: 'autoprefixer',
js_pre_processor: 'babel',
...this.props.options
}

const JSONData = JSON.stringify(data)
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;')
return (
<form action="https://codepen.io/pen/define" method="POST" target="_blank">
<input type="hidden" name="data" value={JSON.stringify(data)} />
<input type="hidden" name="data" value={JSONData} />
<Tooltip renderTip="Edit in Codepen" placement="bottom">
<IconButton
type="submit"
Expand Down

0 comments on commit a518182

Please sign in to comment.