Skip to content

Commit

Permalink
it works goshdanggit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjmhart committed Jan 20, 2019
1 parent ed6c6cf commit e5a00e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/core/parcel-bundler/src/Pipeline.js
Expand Up @@ -49,7 +49,6 @@ class Pipeline {

let inputType = path.extname(asset.name).slice(1);
let generated = [];

for (let rendition of this.iterateRenditions(asset)) {
let {type, value} = rendition;
if (typeof value !== 'string' || rendition.final) {
Expand Down Expand Up @@ -117,7 +116,7 @@ class Pipeline {
type,
value: asset.generated[type],
// for scope hoisting, we need to post process all JS
final: !(type === 'js' && this.options.scopeHoist)
final: !((type === 'js' && this.options.scopeHoist) || type === 'html')
};
}
}
Expand Down
13 changes: 9 additions & 4 deletions packages/core/parcel-bundler/src/assets/MarkdownAsset.js
@@ -1,11 +1,16 @@
const localRequire = require('../utils/localRequire');
const HTMLAsset = require('./HTMLAsset');
const Asset = require('../Asset');

class MarkdownAsset extends HTMLAsset {
class MarkdownAsset extends Asset {
constructor(name, options) {
super(name, options);
this.type = 'html';
this.hmrPageReload = true;
}
async parse(code) {
let marked = await localRequire('marked', this.name);
return HTMLAsset.prototype.parse.bind(this)(marked(code));
this.contents = marked(code);
return this.contents;
}
}

module.exports = MarkdownAsset;

0 comments on commit e5a00e7

Please sign in to comment.