Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marked:renderer filter #129

Merged
merged 7 commits into from
Dec 23, 2019
Merged

Add marked:renderer filter #129

merged 7 commits into from
Dec 23, 2019

Conversation

jiangtj
Copy link
Member

@jiangtj jiangtj commented Dec 23, 2019

As in the test case, exposing the renderer object, and give the outside the ability to modify it.

@coveralls
Copy link

coveralls commented Dec 23, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling dd7f01c on jiangtj-lab:filter2 into 2b15765 on hexojs:master.

lib/renderer.js Outdated Show resolved Hide resolved
test/index.js Outdated Show resolved Hide resolved
test/index.js Outdated Show resolved Hide resolved
test/index.js Outdated Show resolved Hide resolved
Co-Authored-By: Sukka <isukkaw@gmail.com>
test/index.js Outdated Show resolved Hide resolved
jiangtj and others added 2 commits December 23, 2019 17:17
Co-Authored-By: Sukka <isukkaw@gmail.com>
Copy link
Member

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@curbengh What do you think?

@SukkaW SukkaW requested a review from curbengh December 23, 2019 09:27
@@ -132,7 +132,11 @@ module.exports = function(data, options) {
}
});

// exec filter to extend renderer.
const renderer = new Renderer();
this.execFilterSync('marked:renderer', renderer, {context: this});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume execFilter() is not used because marked is not async?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@curbengh marked support async, but in hexo-renderer-marked, no.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible for this plugin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume execFilter() is not used because marked is not async?

I tried execFilter(), but fail. This is beyond my ability 😂 . @curbengh good job.

@curbengh
Copy link
Contributor

curbengh commented Dec 23, 2019

@curbengh What do you think?

This is a good feature. 👍

Seems helpful to hexojs/hexo#3889, @aaaa0long: this means you no longer need to fork this plugin.

@SukkaW SukkaW merged commit 64660b1 into hexojs:master Dec 23, 2019
@curbengh
Copy link
Contributor

I managed to replace cheerio with this feature 👍
https://gitlab.com/curben/blog/commit/3beca85f47def39221a8016a46c5bffc5bd2dc8a

This was referenced Dec 24, 2019
@jiangtj jiangtj deleted the filter2 branch December 24, 2019 11:39
curbengh pushed a commit to curbengh/curbengh.github.io that referenced this pull request Apr 15, 2020
@stevenjoezhang
Copy link
Member

stevenjoezhang commented Apr 21, 2020

New feature marked.use added in marked@1.0.0 which makes it easier to customize marked, both renderer and tokenizer.

#129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants