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
go/doc: doc package converts smart quotes in preformatted blocks #29730
Comments
/cc @robpike @griesemer |
It's go/doc. @griesemer? |
I haven't investigated in detail but probably happens in go/doc/comment.go somewhere. This sounds like a good starter problem for somebody to fix. |
I made the convertQuotes change, which converts these special quotes to unicode quotes. But we were never checking for preformatted blocks. For 1.11, it will be -
For 1.12, it will be -
@griesemer - Are you fine with ignoring these conversions in preformatted blocks ? We will then need to add the logic to check for preformatted blocks. |
@agnivade It makes sense to leave preformatted blocks alone, but I don't have the full picture in my head at the moment. Probably worthwhile making sure we have a plan that doesn't require this changing back and forth in each release. |
Note that the code already doesn't convert quotes in the HTML output. |
Change https://golang.org/cl/162922 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Git master.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
smartquotes.go
go doc Bar
in that package directory.What did you expect to see?
What did you see instead?
➜ ~/prj/go/bin/go doc Bar func Bar(s string) Bar does “stuff” Bar(“ + ”)
The preformatted block has smart quotes converted.
Analysis
Smart quotes are converted here:
go/src/go/doc/comment.go
Line 448 in 4e8aaf6
But it's explicitly not done in HTML output here:
go/src/go/doc/comment.go
Line 332 in 4e8aaf6
By the final
false
argument. So it probably shouldn't be done for the text format too.The text was updated successfully, but these errors were encountered: