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

refactor: remove alias json for support add custom language support #414

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

yutingzhao1991
Copy link

check list

  • Add test cases for the changes.
  • Passed the CI test.

Description

use hljs.getLanguage for check language support, so I can add new language support with hexo plugin.

Additional information

for hexojs/hexo#5639

@coveralls
Copy link

coveralls commented Mar 5, 2025

Coverage Status

coverage: 96.875%. remained the same
when pulling 8a82343 on yutingzhao1991:feat/includelangs
into 1ad96ca on hexojs:master.

@stevenjoezhang
Copy link
Member

The highlight_alias.json file was introduced almost a decade ago, apparently to address efficiency issues with loading aliases in highlight.js: 7f6469e
If this issue no longer exists, using hljs.getLanguage would indeed be a better option.

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.

What about still preferring the alias, but even if the existing alias doesn't match, then use the hljs.getLanguage as a fallback? This prevents unexpected behavior changes.

@yutingzhao1991
Copy link
Author

What about still preferring the alias, but even if the existing alias doesn't match, then use the hljs.getLanguage as a fallback? This prevents unexpected behavior changes.

You are right, I already fix it.

btw: many useless commit, use squash merge.

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 now. What do you think? @hexojs/core

@SukkaW SukkaW requested a review from a team March 15, 2025 14:36
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.

@yutingzhao1991
Would you please fix lint errors? Other than that, LGTM.

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