Markdown Previewer

Developer
Size
3,402 Kb
Views
4,048

How do I make an markdown previewer?

What is a markdown previewer? How do you make a markdown previewer? This script and codes were developed by Matheus on 13 January 2023, Friday.

Markdown Previewer Previews

Markdown Previewer - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Markdown Previewer</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="root"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js'></script>
<script src='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Markdown Previewer - Script Codes CSS Codes

.app { margin-top: 25px;
}

Markdown Previewer - Script Codes JS Codes

"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var MarkDown = function (_React$Component) { _inherits(MarkDown, _React$Component); function MarkDown(props) { _classCallCheck(this, MarkDown); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props)); _this.state = { value: "#Header1\n ##Header2\n ###Header3 \n ======= \n\n **This is bold text** \n\n *This is italic text* \n\n ``This is code text`` \n\n ~~This is strikethrough text~~ \n\n ======= \n\n This is a list of options: \n * Option1\n * Option2\n * Option3" }; _this.handleChange = _this.handleChange.bind(_this); _this.handleSubmit = _this.handleSubmit.bind(_this); return _this; } MarkDown.prototype.createMarkup = function createMarkup(param) { return { __html: param }; }; MarkDown.prototype.handleChange = function handleChange(event) { this.setState({ value: event.target.value }); }; MarkDown.prototype.handleSubmit = function handleSubmit(event) { alert('An essay was submitted: ' + this.state.value); event.preventDefault(); }; MarkDown.prototype.render = function render() { return React.createElement( "div", { className: "row" }, React.createElement( "div", { className: "col-md-5 col-md-offset-1" }, React.createElement("br", null), React.createElement("textarea", { rows: "23", cols: "50", value: this.state.value, onChange: this.handleChange }) ), React.createElement( "div", { className: "col-md-6" }, React.createElement("div", { dangerouslySetInnerHTML: this.createMarkup(marked(this.state.value)) }) ) ); }; return MarkDown;
}(React.Component);
ReactDOM.render(React.createElement(MarkDown, null), document.getElementById('root'));
Markdown Previewer - Script Codes
Markdown Previewer - Script Codes
Home Page Home
Developer Matheus
Username MatheusLima92
Uploaded January 13, 2023
Rating 3
Size 3,402 Kb
Views 4,048
Do you need developer help for Markdown Previewer?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Matheus (MatheusLima92) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!