- Markdown previewer is an app that allows users to write GitHub flavored markdown into an editor, and to preview it instantly on the Previewer(output).
- The editor is a controlled input by the
useState
hook that updates its value as the writer is typing. - The GitHub flavored markdown is parsed using the 'react-marked'. The option
break
has been set to true withmarked.setOptions()
, so the markdown previewer interprets carriage returns and renders them asbr
elements. - The main challenge on this project was to find out about
dangerouslySetInnerHTML
to render the raw HTML, we get from marked, properly. Without it, the text or content coming from the marked will be just a string, but when we usedangerouslySetInnerHTML
React becomes aware of the HTML tags and renders them properly.
- First, use
npm install
to install all the dependencies. - Start the devolopment server
npm start
. - For more information please refer to react-app