You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privaterenderHeaderTitle(){constchangeStatuses=this.computeChangeStatusChips();constresolveWeblinks=this.revision?.commit?.resolve_conflicts_web_links??[];returnhtml` <divclass="headerTitle"><divclass="changeStatuses">${changeStatuses.map(status=>html` <gr-change-status.revertedChange=${this.revertingChange}.status=${status} .resolveWeblinks=${resolveWeblinks}></gr-change-status>`)}</div>${this.renderCopyLinksDropdown()}<gr-buttonflattendown-arrowclass="showCopyLinkDialogButton"@click=${(e: MouseEvent)=>{// We don't want to handle clicks on the star or the <a> link.// Calling `stopPropagation()` from the click handler of <a> is not an// option, because then the click does not reach the top-level gr-page// click handler and would result is a full page reload.if((e.targetasHTMLElement)?.nodeName!=='GR-BUTTON')return;this.copyLinksDropdown?.toggleDropdown();}}><gr-change-starid="changeStar".change=${this.change}@toggle-star=${(e: CustomEvent<ChangeStarToggleStarDetail>)=>this.handleToggleStar(e)} ?hidden=${!this.loggedIn}></gr-change-star><aclass="changeNumber"aria-label=${`Change ${this.change?._number}`}href=${ifDefined(this.computeChangeUrl(true))}>${this.change?._number}</a></gr-button><spanclass="headerSubject">${this.change?.subject}</span><gr-copy-clipboardclass="changeCopyClipboard"hideInput=""text=${this.computeCopyTextForTitle()}></gr-copy-clipboard></div>`;}
Expected behavior
Highlighting not to break after ${(e: MouseEvent) => {
Oh... it appears to be due to the use of // within ${(e: MouseEvent) => {
Ah because of ' in don't.
paladox
changed the title
(typescript) Highlighting breaks if using ${(e: MouseEvent) => {} in html tag
(typescript) Highlighting breaks if using ' in a comment word (e.g // don't)
Feb 20, 2024
Seems a comment isn't properly highlighted as a comment within ${(e: MouseEvent) => {. As you can see if you do it in private renderHeaderTitle() {, it's grey. But within ${(e: MouseEvent) => { it's red. Highlighting breaks when using a '.
Describe the issue
Which language seems to have the issue?
Typescript
Are you using
highlight
orhighlightAuto
?highlight
Sample Code to Reproduce
You can reproduce with the following on https://highlightjs.org/demo
Expected behavior
Highlighting not to break after
${(e: MouseEvent) => {
Additional context
Happens on https://gerrit-review.googlesource.com/c/gerrit/+/410005/2/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.ts
The text was updated successfully, but these errors were encountered: