golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.37k stars 17.38k forks source link

x/pkgsite: README.md shows non-breaking space and non-breaking hyphen as   and ‑ strings #37394

Closed x448 closed 3 years ago

x448 commented 4 years ago

This makes correct text look like it has typos when viewed by prospective employers, etc. on go.dev.

GitHub doesn't have any problems and you can see the difference in the screenshots.

Here's a screenshot from go.dev, from github.com, and the markdown code.

/cc @julieqiu @dmitshur

What did you see? (go.dev screenshot)

Problems in the screenshot include:

Preferred\ serialization Well\‑formedness\ checks RFC\ 7049\ Section\ 8\ Security\ Considerations.

image

What did you expect to see? (github.com screenshot)

image

Reproducer (markdown snippet)

This is from fxamacker/cbor. The   and ‑ allow the text to avoid messy line breaks in the "CBOR Feature" column. The last row of "Description" is also a problem on go.dev.

|     | CBOR Feature | Description |
| --- | :--- | :--- |
| ✔️ | CBOR tags | API supports built-in and user-defined tags. |
| ✔️ | Preferred serialization | Integers encode to fewest bytes. Optional float64→float32→float16 if value fits. |
| ✔️ | Sort map keys | Unsorted, length-first (Canonical CBOR), and bytewise-lexicographic (CTAP2) |
| ✔️ | Duplicate map keys | Always forbid for encoding, option to allow/forbid for for decoding. |
| ✔️ | Indefinite length data | Option to allow/forbid for encoding and decoding. |
| ✔️ | Well‑formedness checks | Always checked and enforced. |
| ✔️ | Basic validity checks | UTF-8 validity, etc. checked after well-formedness. |
| ✔️ | Security considerations | Prevent integer overflow and resource exhaustion described in RFC 7049 Section 8 Security Considerations. |
julieqiu commented 4 years ago

Thanks for reporting! We're working on fixes for this and other README rendering issues.

x448 commented 4 years ago

Julie, I appreciate your reply and your work trying to fix this.

I'm just sharing this with you in case there's anyone on your team that's under the impression there's a workaround available.

There is no workaround for this issue and #37284 because go.dev shows all past releases.

I don't think there's anything maintainers can do to make fxamacker/cbor v2.2.0 and prior versions render correctly on go.dev. All maintainers can do is continue converting a dozen markdown tables to svg, and etc. so that v2.3.0 can look nice on go.dev.

I hope you're having a great day and know that lots of people outside of Google also appreciate & value your work!

julieqiu commented 4 years ago

@x448 - Thanks for the feedback, and I am happy to hear that you are enjoying using pkg.go.dev!

I understand the README issues have been frustrating - I have a fix in review for #37284, which I hope to have live next week, and am currently looking into this issue.

We are also working towards open sourcing the site (https://groups.google.com/g/golang-dev/c/mfiPCtJ1BGU/m/OZ9cU3SgBgAJ), so that in the future we can accept contributions for issues like this.

I'll update this issue once the fix has been merged, and also when it is live on the site. Thanks for being patient, and hope this helps!

x448 commented 4 years ago

Hey Julie, this is fantastic news! Thanks so much for letting me know and sharing as much info as you did! I think @fxamacker and others will appreciate it as well.

Open sourcing pkg.go.dev is a really great decision. I heard a rumor that might be happening so this confirmation is really nice. Revenue generating features could simply build on top of it so it's smart.

Thanks again for coming to the rescue on the two issues. Seeing dmitshur give you a thumbs up on your comment made me happy too. Have a fantastic weekend!

x448 commented 4 years ago

Hi! I discovered this problem is not limited to tables.

This can be seen by bringing up the README of fxamacker/cbor v2.1.0 (not latest version) on go.dev and searching for nbsp (it's in the Comparisons section).

FYI - (you probably know about this) GitHub Flavored Markdown Spec highlights where they differ from regular markdown and also includes 650+ examples/tests.

p.s.

Julie's fix for #37284 not only worked but it's is beautiful!

jamalc commented 3 years ago

@x448 - this should now be fixed.