highlightjs / highlightjs/highlight.js

(typescript) `<string[]>` breaks highlighting

Open
#4,301 1 comment 0 reactions 0 assignees View on GitHub
bug help welcome language
Dominant language
JavaScript
Stars
25k
Forks
3.8k
Avg merge
11h 35m
Merged PRs (30d)
3

Description

**Describe the issue**
The type cast `` (or any array `[]` notation) in typescript breaks the highlighting and nothing after this point will be highlighted. Seems to be focused on variable assignment. Other places like property types of `string[]` work fine.

**Which language seems to have the issue?**
typescript

**Are you using `highlight` or `highlightAuto`?**
`highlight`

**Sample Code to Reproduce**
```typescript
const myVar = this.service.invoke();
```
See https://jsfiddle.net/Lom83wne/

**Expected behavior**
The highlighting shouldn't break after the array `[]` notation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.