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

Invalid characters in documentation #2553

Closed
urbansky opened this issue Dec 20, 2019 · 4 comments
Closed

Invalid characters in documentation #2553

urbansky opened this issue Dec 20, 2019 · 4 comments
Labels
type: bug Something isn't working type: docs

Comments

@urbansky
Copy link

It sounds strange, but when I copy source code from the documentation and paste it into my IDE I get error messages.

For example, when I click on 'Copy to Clipboard' at https://docs.micronaut.io/1.3.0.M1/guide/index.html#_scheduling_at_a_fixed_rate and paste, I get an error message in IntelliJ and with Gradle-Build the following error message:

'unexpected token: ​ @'

If I delete a hidden character before 'void' everythings works fine.

I know that is a strange issue. But for beginners it can be very confusing.

@graemerocher graemerocher added type: docs type: bug Something isn't working labels Dec 20, 2019
@sgmeligmeyling
Copy link
Contributor

I observed that this issue only occurs in Chrome and not in Firefox or Edge, and also not for all code snippets. After digging around for a while, it seems that the CSS rule

pre {
white-space: pre-wrap;
}

causes the zero-width spaces to appear. I have found that switching this off or adding the rule

pre.highlight {
    white-space: pre;
}

removes the invalid characters. I think this would have to be done in micronaut-docs, but I'm not sure in which stylesheet it belongs.

@utsav0209
Copy link
Contributor

utsav0209 commented May 1, 2021

@graemerocher If we exclude white-space: pre-wrap; or use white-space: pre; it will cause a horizontal scroll-bar to come, if that's fine then I think I know what to change

image

@graemerocher
Copy link
Contributor

@utsav0209 probably better than having broken code copied. Thanks for looking into t

@mattmoss
Copy link
Contributor

mattmoss commented Jan 12, 2022

Verified that this is fixed in latest documentation published (i.e. https://docs.micronaut.io/latest/guide)

Existing published documentation (prior to 2.5.13 for 2.x, prior to 3.0.1 for 3.x) still has the issue. Beginners should now be looking to use latest stuff, which works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: docs
Projects
None yet
Development

No branches or pull requests

5 participants