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

(typescript) optional property not highlighted correctly #3613

Open
unional opened this issue Sep 10, 2022 · 5 comments · May be fixed by #4114
Open

(typescript) optional property not highlighted correctly #3613

unional opened this issue Sep 10, 2022 · 5 comments · May be fixed by #4114
Labels
bug help welcome Could use help from community language

Comments

@unional
Copy link

unional commented Sep 10, 2022

Describe the issue
optional property (prop?: number) not highlighted correctly.

Which language seems to have the issue?
TypeScript

Are you using highlight or highlightAuto?
highlight? Using highlightjs through revealjs VSCode extension.

Sample Code to Reproduce

type Options = {
  srcdir: string,
  outdir: string,
  minify?: boolean
}

Result (using Github Dark):
image

Expected behavior

As seen above, rendered by Github

@unional unional added bug help welcome Could use help from community language labels Sep 10, 2022
@joshgoebel
Copy link
Member

In TS can you write: prop ?: number?

@unional
Copy link
Author

unional commented Sep 11, 2022

@Tokimon
Copy link

Tokimon commented Jul 15, 2023

I have the same problem even almost a year later. And I tried the space trick, but it still doesn't parse it correctly.
image
(elm is correctly parsed, but not key nor data)

Any prospects of this being corrected?

@iSuslov
Copy link

iSuslov commented May 5, 2024

Bumping it up.

In TS can you write: prop ?: number ?

@joshgoebel yes, it is used all over the place in typescript. More often without space in between key name and a question mark.

Example from the typescript repo.

@Dxuian Dxuian linked a pull request Sep 9, 2024 that will close this issue
2 tasks
@Dxuian
Copy link
Contributor

Dxuian commented Sep 9, 2024

@joshgoebel i believe i've managed to fix this please review #4114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants