Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ TIP: The default slot only renders **once** at the beginning, and it will overwr
| anchorAttributes | Object | `{}` | anchor tag attributes such as `target: '_blank'` or `rel: 'nofollow'` |
| prerender | Function (String) String | `null` | filter function before markdown parse |
| postrender | Function (String) String | `null` | filter function after markdown parse |
| inline | Boolean | `false` | result will NOT be wrapped into `<p>` tags |

# Events

Expand Down
18 changes: 16 additions & 2 deletions dist/vue-markdown.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ return /******/ (function(modules) { // webpackBootstrap
default: function _default(htmlData) {
return htmlData;
}
},
inline: {
type: Boolean,
default: false
}
},

Expand Down Expand Up @@ -318,8 +322,18 @@ return /******/ (function(modules) { // webpackBootstrap
});
}

var outHtml = this.show ? this.md.render(this.prerender(this.sourceData)) : '';
outHtml = this.postrender(outHtml);
var outHtml = void 0;
if (this.show) {
outHtml = this.prerender(this.sourceData);
if (this.inline) {
outHtml = this.md.renderInline(outHtml);
} else {
outHtml = this.md.render(outHtml);
}
outHtml = this.postrender(outHtml);
} else {
outHtml = '';
}

this.$emit('rendered', outHtml);
return createElement('div', {
Expand Down
Loading