Skip to content

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

Merged
yoshinorin merged 8 commits intohexojs:masterfrom
yutingzhao1991:feat/includelangs
Apr 17, 2025
Merged

refactor: remove alias json for support add custom language support#414
yoshinorin merged 8 commits intohexojs:masterfrom
yutingzhao1991:feat/includelangs

Conversation

@yutingzhao1991
Copy link
Contributor

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.

Signed-off-by: Mimi <stevenjoezhang@gmail.com>
@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
Contributor 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.

SukkaW
SukkaW previously approved these changes Mar 15, 2025
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.

@yoshinorin yoshinorin merged commit a7c23c7 into hexojs:master Apr 17, 2025
20 of 22 checks passed
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