Interactive Markdown Previewer
Salesforce applications frequently require users to input and display rich text content, from knowledge articles to Chatter posts. Building a robust text editor with real-time feedback is a common challenge. This problem focuses on developing a simplified interactive markdown previewer, demonstrating your ability to manage UI state, handle user input, and implement basic text transformation logic in a React environment.
Your primary task is to build a React component that allows users to type markdown text into an input area and see a live HTML preview of that markdown in an adjacent display area.
textarea element where users can type markdown.div) that renders the parsed HTML version of the markdown entered in the input area.textarea.# Heading 1 -> <h1>Heading 1</h1>## Heading 2 -> <h2>Heading 2</h2>### Heading 3 -> <h3>Heading 3</h3>**bold text** -> <strong>bold text</strong>*italic text* -> <em>italic text</em>- List item 1 -> <ul><li>List item 1</li></ul>- List item 2 -> <ul><li>List item 2</li></ul><ul> block.)textarea and the preview area should be displayed side-by-side, occupying roughly equal horizontal space. Use a clean, responsive layout (e.g., flexbox or grid).textarea should be clearly distinguishable and have an appropriate aria-label for accessibility.textarea for markdown input is fully editable.textarea changes.#) followed by text renders correctly as an <h1>.##) followed by text renders correctly as an <h2>.###) followed by text renders correctly as an <h3>.**text**) renders correctly as <strong>.*text*) renders correctly as <em>.- ) render correctly as <li> elements within a <ul>. Multiple consecutive list items are grouped into a single <ul>.Constraints
marked, markdown-it, react-markdown) are allowed. You are expected to implement the parsing logic yourself using basic string manipulation (e.g., split, replace, regex).useState) is sufficient. No need for global state management libraries.useState), and event handling.Loading editor...