Feb. 22, 2024, 1:26 p.m. | IamSh

DEV Community dev.to




Creating a Markdown to HTML Converter


https://sopkit.github.io/markdown-to-html-converter/



We will Use the JavaScript Library - Showdown








<!DOCTYPE html>
<html>
<head>
<title>Markdown to HTML Converter</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
</head>
<body>
<div class="container">
<h2>Markdown to HTML Converter</h2>
<textarea id="inputText" rows="10" cols="50" placeholder="Enter Markdown text"></textarea><br>
<button onclick="convertToHtml()">Convert to HTML</button>
<button onclick="convertToMarkdown()">Convert to Markdown</button><br><br>

<div class="result-container">
<div class="code-container">
<h3>HTML Code</h3>
<button onclick="copyHtmlCode()">Copy HTML</button>
<textarea id="htmlCode" rows="10" cols="50" readonly></textarea>
</div>
<div class="parsed-container">
<h3>Parsed HTML</h3>
<button onclick="copyParsedHtml()">Copy Parsed HTML</button>
<div id="parsedHtml"></div>
</div>
</div>
</div> …

class code converter css head html javascript library markdown text type will

Data Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne

Senior Machine Learning Engineer (MLOps)

@ Promaton | Remote, Europe

Software Engineer, Data Tools - Full Stack

@ DoorDash | Pune, India

Senior Data Analyst

@ Artsy | New York City