-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
38 lines (25 loc) · 1010 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import ReactDOM from "https://esm.sh/react-dom";
class Input extends React.Component {
constructor(props) {
super(props);
this.state = {
markdown: "" };
}
updateMarkdown(markdown) {
this.setState({ markdown });
}
render() {
return /*#__PURE__*/(
React.createElement("div", { class: "container" }, /*#__PURE__*/
React.createElement("textarea", { id: "editor",
value: this.state.markdown,
onChange: e => {this.updateMarkdown(e.target.value);
} },
console.log(this.state.markdown)), /*#__PURE__*/
React.createElement("div", { id: "preview", class: "container", dangerouslySetInnerHTML: { __html: this.state.markdown } }), /*#__PURE__*/
React.createElement(Output, null)));
}}
const Output = (props) => /*#__PURE__*/
React.createElement("div", null, /*#__PURE__*/
React.createElement("div", null, props.output));
ReactDOM.render( /*#__PURE__*/React.createElement(Input, null), document.getElementById("markup"));