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

typedoc does not handle shiki language aliases #1672

Closed
StoneCypher opened this issue Aug 29, 2021 · 1 comment · Fixed by #1673
Closed

typedoc does not handle shiki language aliases #1672

StoneCypher opened this issue Aug 29, 2021 · 1 comment · Fixed by #1673
Labels
bug Functionality does not match expectation

Comments

@StoneCypher
Copy link
Contributor

StoneCypher commented Aug 29, 2021

Expected Behavior

typedoc should understand language aliases.

Many languages in shiki have aliases. At this time typedoc believes that these aliases are "fakes" and manually handles the five for typescript-as-ts, javascript-as-js, and shell-as-[sh, bash, zsh] in creating the supported language list.

Shiki offers an aliases field which should be walked instead. Many other aliases, such as ruby-as-rb, python-as-py, jssm-as-fsl and so on are being missed, and the ones being manually loaded become unnecessary.

Actual Behavior

typedoc does not understand language aliases, except the five manually added to the list.

Steps to reproduce the bug

Attempt to highlight the following two blocks.

\```ruby
puts "this will work";
\```
\```rb
puts "this will not work, but should";
\```

Note: that backslash shouldn't be there, I just don't know how to quote a triple tick in a fence block

PR incoming

Environment

  • Typedoc version: 0.21.8
  • TypeScript version: irrelevant
  • Node.js version: irrelevant
  • OS: irrelevant
@StoneCypher StoneCypher added the bug Functionality does not match expectation label Aug 29, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 29, 2021

So that's where those are defined! I figured they must be listed somewhere, but never ended up discovering where.

StoneCypher added a commit to StoneCypher/typedoc that referenced this issue Aug 29, 2021
Gerrit0 pushed a commit that referenced this issue Aug 29, 2021
* Fetches language aliases from shiki, fixes #1672
* test cases
* fix formatting with prettier --write .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants