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

regression: rendering of strings has bad syntax highlighting #17890

Closed
timotheecour opened this issue Apr 29, 2021 · 3 comments
Closed

regression: rendering of strings has bad syntax highlighting #17890

timotheecour opened this issue Apr 29, 2021 · 3 comments
Labels
Documentation Generation Related to documentation generation (but not content). Regression

Comments

@timotheecour
Copy link
Member

timotheecour commented Apr 29, 2021

Example

proc fn*() =
  runnableExamples:
    let a = "ok1\nok2\nok3"
    let b = "ok1\nok2 alt\nok3"

nim doc main

Current Output

image

Expected Output

output with 1.2 was better:
image

Additional Information

1.5.1 01bca8c
/cc @a-mr if you have any ideas?

@timotheecour timotheecour added Regression Documentation Generation Related to documentation generation (but not content). labels Apr 29, 2021
a-mr added a commit to a-mr/Nim that referenced this issue May 1, 2021
@a-mr
Copy link
Contributor

a-mr commented May 1, 2021

the same bug is in 1.4 and it's a bug in highlite.nim.

I was not able to determine the origin of regression: checking git log showed that no essential change was done in highlite.nim between 1.2 and 1.4. I thought for a moment that it's escape sequences being highlighted with the same color as string literals, but it seems doc/nimdoc.css already had the dedicated color for --escape in 1.2. :-/

Anyway output for 1.2 is not correct because \n is not highlighted.

@timotheecour
Copy link
Member Author

I was not able to determine the origin of regression

git bisect should work (comparing presence of a bad string in the html or css), but maybe in this case we don't need to figure out which commit introduced this change and it can be fixed directly

Anyway output for 1.2 is not correct because \n is not highlighted.

hmm, it's subjective though; should it highlight it? i don't mind if it does but at least shouldn't be highlighted as above

@Araq Araq closed this as completed in 287f117 May 3, 2021
@a-mr
Copy link
Contributor

a-mr commented May 3, 2021

@timotheecour
git bisect showed that the first "bad" commit is e013ebc.

PMunch pushed a commit to PMunch/Nim that referenced this issue Mar 28, 2022
)

* highlite: fix nim-lang#17890 - tokenize Nim escape seq-s

* Update tests/stdlib/thighlite.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content). Regression
Projects
None yet
Development

No branches or pull requests

2 participants