Markdown Previewer
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 - 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'));
Developer | Matheus |
Username | MatheusLima92 |
Uploaded | January 13, 2023 |
Rating | 3 |
Size | 3,402 Kb |
Views | 4,048 |
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!
Name | Size |
Alumni ECA | 3,777 Kb |
Portfolio | 7,721 Kb |
A Pen by Matheus | 3,441 Kb |
Quote Machine | 2,578 Kb |
Game of Life | 6,575 Kb |
Test environment | 1,781 Kb |
Weather App | 4,587 Kb |
Recipe Box | 9,514 Kb |
Wikipedia viewer | 3,085 Kb |
Tic-Tac-Toe Game - Jquery | 5,818 Kb |
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!
Name | Username | Size |
Filter inputs | Rowinf | 1,721 Kb |
A Pen by Jonas Bjork | Jonasbjork | 3,115 Kb |
Starfield using KineticJS | Asp | 3,512 Kb |
Sass Radar | Jlong | 6,887 Kb |
Bootstrap example | Ssaakkaa | 2,716 Kb |
Transitioning application screens with semantically named classes | Djgrant | 3,697 Kb |
OnScreenAction | Ozgursagiroglu | 2,647 Kb |
React Template | Isac | 1,241 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
Starting out with Ember.JS | Cfleschhut | 4,808 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!