markbind icon indicating copy to clipboard operation
markbind copied to clipboard

Fenced code keyword highlighting cannot highlight @ sign

Open damithc opened this issue 7 months ago • 3 comments

This feature seems to have regressed.

Example from CS2103 website left: v6.0.0, right v5.6.0

Image

code:

```java{highlight-lines="1['@@author'],6['@@author']"}
  //@@author {yourGithubUsername}-reused
  //{Info about the source...}

  {Reused code (possibly with minor modifications) here ...}

  //@@author

Caused by the new custom colour highlighting feature (due to the use of @)?

damithc avatar May 01 '25 10:05 damithc

@IanCheah can have a look, when you have time?

damithc avatar May 01 '25 10:05 damithc

Hi @damithc it is indeed due to the use of @. I tried changing the use of @ to ~ and it works fine. Do you think it is acceptable to move on with this approach, or you would prefer an alternative approach? I think we have to choose a character that is rarely used to avoid similar issues in the future.

IanCheah avatar May 02 '25 04:05 IanCheah

I tried changing the use of @ to ~ and it works fine. Do you think it is acceptable to move on with this approach, or you would prefer an alternative approach? I think we have to choose a character that is rarely used to avoid similar issues in the future.

@IanCheah Thanks for looking into this. Choosing a rarely used character will still cause this problem at some point :-( Note that this problem occurs when using keywords to highlight -- to the naked eye, it is clear the @ is meant to be highlighted and not specifying a colour. Perhaps possible to avoid the misinterpretation by using better parsing?

damithc avatar May 02 '25 04:05 damithc