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

Added filter marked:use for direct access to the marked.use function #273

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

crycode-de
Copy link
Contributor

Background:
The marked-alert extension enables usage of GFM alerts.
To use this extension (and maybe some others) the current marked:extensions filter is not enough since it only provides the extensions property but the altert extension also requires walkTokens to be set in marked.use(...).

This PR adds a marked:use filter allowing the usage of the marked.use function in a theme.

Usage example:

const markedAlert = require('marked-alert');

hexo.extend.filter.register('marked:use', function (markedUse) {
  markedUse(markedAlert());
});

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thanks :)

@yoshinorin yoshinorin merged commit b6ac346 into hexojs:master Apr 1, 2024
11 checks passed
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling d192435 on crycode-de:master
into 1b09354 on hexojs:master.

@yoshinorin
Copy link
Member

@crycode-de
We released a new version (v6.3.0) which includes this feature.
https://www.npmjs.com/package/hexo-renderer-marked/v/6.3.0

Thank you :)

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.

3 participants