Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
save ({name, path}, data, cb) {
/* eslint-disable */
let template, styles, code
const scripts = `
export const renderToString = (body, options = {}) => {
setOptions(options)
const sheet = new ServerStyleSheet()
const bodyStyless = pretty(renderToStaticMarkup(sheet.collectStyles(body)))
const styles = sheet.getStyleElement()[0]
// eslint-disable-next-line no-underscore-dangle
const css = styles ? styles.props.dangerouslySetInnerHTML.__html : ''
const head = pretty(renderToStaticMarkup())
.replace('<style></style>', store.boilerplate)
return `\n\n${head}\n${bodyStyless}\n`
}
render() {
const { children } = this.props;
const markup = pretty(ReactDOMServer.renderToStaticMarkup(children));
const channel = addons.getChannel();
channel.emit('evgenykochetkov/static-markup/show-markup', markup);
return children;
}
}
it('should render correctly', () => {
const root = mount(
{}}
requestClose={() => {}}
urls={{}}
brands={[]}
/>
)
expect(pretty(root.html())).toMatchSnapshot()
})
})
export function getVueCode(soul) {
let data = {},
vueHtml = '<template>' + getVueHtml(soul,data) + '</template>',
vueScript = getVueScript(data)
return vueHtml+'\r\n'+pretty(vueScript)
}
beautify() {
let prettyHtml = pretty(this.state.html);
let prettyJsx = pretty(this.state.jsx);
this.setState({
html: prettyHtml,
jsx: prettyJsx,
isJsxMode: this.state.isJsxMode,
editorHeight: this.state.editorHeight
});
}
initCodeString = () => {
let codeString = '';
if (this.htmlRef.current) {
codeString = pretty(this.htmlRef.current.innerHTML);
classesToRemove.forEach((str) => codeString = codeString.replace(new RegExp(str, 'g'), ''));
this.setState({codeString});
}
this.setState({codeString});
};
description,
renderedHtml,
renderedCode,
parsedCode,
anatomy,
prototypes
} = this.props;
return (
<h2>{title} <small>{prototypeName}</small></h2>
{description}
<code>
</code><code>
<code>
</code><code>
<code>
</code><code>
</code></code></code><code><code><code>
);
}
}</code></code></code>
beautify() {
let prettyHtml = pretty(this.state.html);
let prettyJsx = pretty(this.state.jsx);
this.setState({
html: prettyHtml,
jsx: prettyJsx,
isJsxMode: this.state.isJsxMode,
editorHeight: this.state.editorHeight
});
}
fileReader.onload = () => {
resolve(pretty(fileReader.result));
};
fileReader.onerror = () => {