Hi here is my solution for In-browser-markdown-editor. I used HTML, CSS, JS.
What challenges did you encounter, and how did you overcome them?It was to turn the markdown into text
lines = lines.map( line => line.replace(/^#{1}\s+(.*)\s*$/, "<h1 class='roboto-slab-bold markdown-main-title'>$1</h1>")); lines = lines.map( line => line.replace(/^#{2}\s+(.*)\s*$/, "<h2 class='roboto-slab-light sub-titleH2'>$1</h2>")); lines = lines.map( line => line.replace(/^#{3}\s+(.*)\s*$/, "<h3 class='roboto-slab-bold sub-titleH3'>$1</h3>")); lines = lines.map( line => line.replace(/^#{4}\s+(.*)\s*$/, "<h4 class='roboto-slab-bold sub-titleH4'>$1</h4>"));
And delete and save the file using the localStorage.
What specific areas of your project would you like help with?document.querySelector('.button-save').addEventListener('click', ( ) => { for(let i = 0; i < arrayJSON.length; i++){ if(document.querySelector('input').value === arrayJSON[i].name){ indexToSave = i; } } arrayJSON[indexToSave].content = document.querySelector('textarea').value; });
Feel free to leave any comments or suggestion.
Thanks.