Skip to content

Commit

Permalink
Merge pull request #502 from axa-group/fix/change-markdown-renderer
Browse files Browse the repository at this point in the history
Replace legacy vue-markdown with marked
  • Loading branch information
jvalls-axa authored Oct 21, 2020
2 parents 6b39c29 + 70380dc commit 4cb5152
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 151 deletions.
156 changes: 11 additions & 145 deletions demo/vue-viewer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/vue-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"dependencies": {
"axios": "^0.19.2",
"core-js": "^2.6.5",
"marked": "^1.2.0",
"sass": "^1.26.3",
"sass-loader": "^7.1.0",
"vue": "^2.6.11",
"vue-markdown": "^2.2.4",
"vue-observe-visibility": "^0.4.6",
"vue-router": "^3.1.6",
"vuetify": "^2.2.17",
Expand Down
12 changes: 7 additions & 5 deletions demo/vue-viewer/src/views/ViewerMarkdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<v-tab>Render</v-tab>

<v-tab-item class="tabItem">
<pre class="text">{{ documentMarkdown }}</pre>
<pre class="text">{{ compiledMarkdown }}</pre>
</v-tab-item>
<v-tab-item class="tabItem">
<vueMarkdown class="text">{{ documentMarkdown }}</vueMarkdown>
<vueMarkdown class="text">{{ compiledMarkdown }}</vueMarkdown>
</v-tab-item>
</v-tabs>

Expand Down Expand Up @@ -42,19 +42,21 @@
</template>
<script>
import { mapState } from 'vuex';
import VueMarkdown from 'vue-markdown';
import marked from 'marked';
export default {
data() {
return { error: null };
},
components: { VueMarkdown },
computed: {
uploadedDocument() {
return this.documentId !== null;
},
documentMarkdownFetched() {
return this.documentMarkdown !== null;
return this.compiledMarkdown !== null;
},
compiledMarkdown: function() {
return marked(this.documentMarkdown, { sanitize: true });
},
...mapState({
documentId: state => state.uuid,
Expand Down

0 comments on commit 4cb5152

Please sign in to comment.