Skip to content

Commit ef017d6

Browse files
committed
Added html and xhtmlOut in parser
1 parent 7367b56 commit ef017d6

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

functions/views/desktop.ejs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@
4040
<body class="<%= theme %>">
4141

4242
<!-- Script Just After Body -->
43-
<script>var md=new Remarkable;document.addEventListener("DOMContentLoaded",function(){window.signInEmail="<%= userEmail %>";window.currentNote="",window.editor={id:"",title:"",description:""},console.log("<%= userEmail %>"),firebase.database().ref("<%= userEmail %>").orderByChild("timestamp").on("value",function(e){var t=[];e.forEach(function(e){var o=e.key,a=e.val();t.push({childKey:o,childData:a})}),t.reverse(),window.notesData={};var o=document.getElementById("note-family");if(o.innerHTML="",noteFamilyString="",t.forEach(function(e){var t=e.childKey,o=e.childData;noteFamilyString+='<div id="'+t+'" class="note-row hoverable" onclick=doOnNoteClick(this) ><div class="note-title">'+o.title+'</div><div class="note-date">'+o.date+"</div></div>",window.notesData[t]={description:o.description,title:o.title}}),o.innerHTML=noteFamilyString,window.currentNote)try{document.getElementById(window.currentNote).classList.add("is--active"),document.getElementById(window.currentNote).classList.remove("hoverable")}catch(e){console.log("Ignore this error, comes at time of delete",e.toString)}}),addNotefunction=((e,t)=>{console.log("Add Note");var o={title:e,description:t,date:(new Date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),timestamp:firebase.database.ServerValue.TIMESTAMP},a=firebase.database().ref("<%= userEmail %>").push().key;console.log(a),window.currentNote=a;var n={};return n[a]=o,firebase.database().ref("<%= userEmail %>").update(n)}),updateNotefunction=((e,t,o)=>{console.log("Update Note");var a={title:t,description:o,date:(new Date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),timestamp:firebase.database.ServerValue.TIMESTAMP},n={};return n[e]=a,firebase.database().ref("<%= userEmail %>").update(n)}),deleteNotefunction=(e=>firebase.database().ref("<%= userEmail %>").child(e).remove())}),signOutFromGoogle=(()=>{saveForUnSavedChanges(),console.log("Sign Out User!");firebase.auth().signOut();var e=new XMLHttpRequest;e.addEventListener("error",function(e){console.log("Failed"),console.log(e.toString())}),e.addEventListener("load",function(e){console.log("Sign Out Success!"),location.reload()}),e.open("POST","/clear",!0),e.setRequestHeader("Content-Type","application/json"),e.send()});</script>
43+
<script>
44+
var md = new Remarkable({
45+
html: true,
46+
xhtmlOut: true
47+
});
48+
</script>
49+
<script>document.addEventListener("DOMContentLoaded",function(){window.signInEmail="<%= userEmail %>";window.currentNote="",window.editor={id:"",title:"",description:""},console.log("<%= userEmail %>"),firebase.database().ref("<%= userEmail %>").orderByChild("timestamp").on("value",function(e){var t=[];e.forEach(function(e){var o=e.key,a=e.val();t.push({childKey:o,childData:a})}),t.reverse(),window.notesData={};var o=document.getElementById("note-family");if(o.innerHTML="",noteFamilyString="",t.forEach(function(e){var t=e.childKey,o=e.childData;noteFamilyString+='<div id="'+t+'" class="note-row hoverable" onclick=doOnNoteClick(this) ><div class="note-title">'+o.title+'</div><div class="note-date">'+o.date+"</div></div>",window.notesData[t]={description:o.description,title:o.title}}),o.innerHTML=noteFamilyString,window.currentNote)try{document.getElementById(window.currentNote).classList.add("is--active"),document.getElementById(window.currentNote).classList.remove("hoverable")}catch(e){console.log("Ignore this error, comes at time of delete",e.toString)}}),addNotefunction=((e,t)=>{console.log("Add Note");var o={title:e,description:t,date:(new Date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),timestamp:firebase.database.ServerValue.TIMESTAMP},a=firebase.database().ref("<%= userEmail %>").push().key;console.log(a),window.currentNote=a;var n={};return n[a]=o,firebase.database().ref("<%= userEmail %>").update(n)}),updateNotefunction=((e,t,o)=>{console.log("Update Note");var a={title:t,description:o,date:(new Date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),timestamp:firebase.database.ServerValue.TIMESTAMP},n={};return n[e]=a,firebase.database().ref("<%= userEmail %>").update(n)}),deleteNotefunction=(e=>firebase.database().ref("<%= userEmail %>").child(e).remove())}),signOutFromGoogle=(()=>{saveForUnSavedChanges(),console.log("Sign Out User!");firebase.auth().signOut();var e=new XMLHttpRequest;e.addEventListener("error",function(e){console.log("Failed"),console.log(e.toString())}),e.addEventListener("load",function(e){console.log("Sign Out Success!"),location.reload()}),e.open("POST","/clear",!0),e.setRequestHeader("Content-Type","application/json"),e.send()});</script>
4450

4551
<script src="js/loadTheme.js"></script>
4652

functions/views/login.ejs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
<script></script> -->
4747

4848
<script>
49-
var md = new Remarkable();
49+
var md = new Remarkable({
50+
html: true,
51+
xhtmlOut: true
52+
});
5053
5154
document.addEventListener('DOMContentLoaded', function () {
5255

0 commit comments

Comments
 (0)