Skip to content

Commit c52d88e

Browse files
committed
Simplifying rich text editor, to the moment.
1 parent 275d484 commit c52d88e

File tree

8 files changed

+130
-683
lines changed

8 files changed

+130
-683
lines changed

package-lock.json

Lines changed: 0 additions & 218 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"cross-spawn": "^6.0.5",
3434
"is-stream": "^1.1.0",
3535
"lodash.clonedeep": "^4.5.0",
36+
"markdown-it": "^8.4.2",
37+
"markdown-it-checkbox": "^1.1.0",
3638
"material-design-icons-iconfont": "^3.0.3",
3739
"pouchdb-browser": "^7.0.0",
3840
"raw-loader": "^0.5.1",

src/components/note-display.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ v-card
99
v-btn(small, icon, :to="{name: 'edit-note', params: {id: id}}")
1010
v-icon edit
1111
v-card-text
12-
pre(v-if="confidential !== true || show_content", style="overflow:auto;") {{ content }}
12+
pre(v-if="confidential !== true || show_content", style="overflow:auto;", v-html="htmlContent")
1313
i(v-else) [{{ $t('confidential') }}]
1414
div(v-if="subjects !== undefined", class="text-xs-right")
1515
v-divider(style="margin: 0.5em 0px;")
@@ -18,6 +18,11 @@ v-card
1818
</template>
1919

2020
<script>
21+
import markdownIt from 'markdown-it';
22+
import markdownItCheckboxes from 'markdown-it-checkbox';
23+
24+
const markdownConverter = markdownIt().use(markdownItCheckboxes);
25+
2126
export default {
2227
name: 'note-display',
2328
props: ['id', 'title', 'content', 'confidential', 'subjects'],
@@ -26,6 +31,11 @@ export default {
2631
show_content: false,
2732
};
2833
},
34+
computed: {
35+
htmlContent() {
36+
return markdownConverter.render(this.content);
37+
},
38+
},
2939
};
3040
</script>
3141

0 commit comments

Comments
 (0)