Skip to content

Commit

Permalink
fix: render markdown in notes on the dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Van Accoleyen committed Feb 14, 2023
1 parent 43f4d0a commit 0469822
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions resources/js/components/dashboard/DashboardLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@
<a :href="'people/' + note.contact.id">
{{ note.name }}
</a>
<p>
{{ note.body }}
</p>
<p v-html="compiledMarkdown(note.body)"></p>
</div>
</div>
</template>
Expand Down Expand Up @@ -334,33 +332,33 @@ export default {
this.saveTab(view);
switch (view) {
case 'calls':
if (! this.callsAlreadyLoaded) {
this.getCalls();
this.callsAlreadyLoaded = true;
}
break;
case 'notes':
if (! this.notesAlreadyLoaded) {
this.getNotes();
this.notesAlreadyLoaded = true;
}
break;
case 'debts':
if (! this.debtsAlreadyLoaded) {
this.getDebts();
this.debtsAlreadyLoaded = true;
}
break;
case 'tasks':
if (! this.tasksAlreadyLoaded) {
this.getTasks();
this.tasksAlreadyLoaded = true;
}
break;
case 'calls':
if (! this.callsAlreadyLoaded) {
this.getCalls();
this.callsAlreadyLoaded = true;
}
break;
case 'notes':
if (! this.notesAlreadyLoaded) {
this.getNotes();
this.notesAlreadyLoaded = true;
}
break;
case 'debts':
if (! this.debtsAlreadyLoaded) {
this.getDebts();
this.debtsAlreadyLoaded = true;
}
break;
case 'tasks':
if (! this.tasksAlreadyLoaded) {
this.getTasks();
this.tasksAlreadyLoaded = true;
}
break;
}
},
Expand Down Expand Up @@ -449,7 +447,11 @@ export default {
.then(response => {
this.tasks.splice(this.tasks.indexOf(task), 1);
});
}
},
compiledMarkdown (text) {
return text !== undefined && text !== null ? marked(text, { sanitize: true }) : '';
},
}
};
</script>

0 comments on commit 0469822

Please sign in to comment.