Skip to content

Commit

Permalink
♻️ : use markdown component in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit authored and cdubuisson committed Apr 9, 2020
1 parent be05718 commit 03d58c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/main/client/app/pages/modules/readme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@
class="m-5"
style="height: 2.5rem; width: 2.5rem"
/>
<div
<app-markdown
v-if="loaded"
class="markdown-body"
>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="content" />
</div>
:content="content"
/>
</b-container>
</template>

<script>
import marked from 'marked';
import { AppMarkdown } from '@/shared/components';
import { getModuleReadme } from '@/shared/api/modules-api';
export default {
name: 'AppReadme',
components: {
AppMarkdown,
},
props: {
moduleId: {
type: String,
Expand All @@ -38,7 +39,7 @@
async created() {
const readme = await getModuleReadme(this.moduleId);
this.content = marked(readme);
this.content = readme;
this.loaded = true;
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/main/client/app/shared/components/markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import marked from 'marked';
export default {
name: 'Markdown',
name: 'AppMarkdown',
props: {
content: {
Expand Down

0 comments on commit 03d58c2

Please sign in to comment.