src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue
changeset 403 0ed5207089ee
parent 402 376158f6d760
child 418 a04c55054afe
--- a/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue	Tue Feb 28 17:00:47 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue	Tue Feb 28 17:08:09 2017 +0100
@@ -24,7 +24,7 @@
             <div v-if="annotation" class="form-group form-group-sm">
                 <label v-if="!readonly || description" class="small text-muted">Description</label>
                 <textarea class="form-control" name="description" v-model="description" v-if="!readonly" placeholder="Décrivez ce que vous voyez"></textarea>
-                <p v-if="readonly && description" v-bind:class="{ 'text-muted': !description }">{{ description || 'Pas de description' }}</p>
+                <p v-if="readonly && description" v-bind:class="{ 'text-muted': !description }" v-html="descriptionComputed">{{ descriptionComputed || 'Pas de description' }}</p>
             </div>
             <div v-if="annotation" class="form-group form-group-sm">
                 <label class="small text-muted">Mots-clés</label>
@@ -44,6 +44,9 @@
 
     import TagList from '../tagform/TagList.vue'
     import _ from 'lodash'
+    import showdown from 'showdown'
+
+    const converter = new showdown.Converter()
 
     var defaults = {
         title: '',
@@ -90,6 +93,9 @@
             }
         },
         computed: {
+            descriptionComputed: function(){
+              return converter.makeHtml(this.description);
+            },
             formAction: function() {
                 if (this.annotation) {
                     return this.action.replace(':annotation_guid', this.annotation.annotation_guid);