Basic Markdown Editor with Live Preview
At OYO, we manage a vast amount of content, from property descriptions to internal knowledge base articles. Ensuring this content is easily authorable and consistently formatted is crucial. Markdown offers a lightweight solution for rich text editing. This problem challenges you to build a simple web-based Markdown editor that provides a real-time preview of the rendered HTML, mimicking a core feature of many modern content management systems.
Your primary task is to create a React component that functions as a basic Markdown editor with a live preview pane. Specifically, you must:
<h1> for # Heading 1 and <h2> for ## Heading 2.**bold text** as <strong>bold text</strong>.*italic text* as <em>italic text</em>.- or * as <li> items within a <ul> block.textarea for Markdown input and a div for HTML preview are visible.# Heading 1 and ## Heading 2 correctly render as <h1> and <h2> in the preview.**bold text** renders as <strong>bold text</strong> in the preview.*italic text* renders as <em>italic text</em> in the preview.- List item or * List item correctly render as <li> elements within a <ul> block in the preview.Constraints
marked, markdown-it) to demonstrate your understanding of string manipulation and transformation. Simple regular expressions are encouraged.React.useMemo (if applicable) are not strictly required within the time limit.dangerouslySetInnerHTML is not expected for this problem, as the parsing logic is controlled internally.Loading editor...