Aws-cdk: hidden characters in doc causing problem for copy/paste

Created on 27 Jul 2019  路  5Comments  路  Source: aws/aws-cdk

On https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html the value max颅Azs is being written as max­Azs so it copy/pastes poorly, specifically on VS Code that retains characters like that apparently, so you end up with an invisible character and your code doesn't work.

Inspecting with Chrome shows the issue:
Screen Shot 2019-07-26 at 3 35 32 PM

This is how it looks when you copy paste it, because it is being pasted as max-Azs:
Screen Shot 2019-07-26 at 3 36 44 PM

I don't know if this issue exists elsewhere in the docs.

The change I would like to have happen is to make it possible to copy/paste that variable from the docs without an invisible character ending up in it.

bug

Most helpful comment

That is my bad. We are doing this to make long identifiers wrap naturally when the screen size gets narrow, or for very long columns.

I will investigate another way achieving this. Replacing soft hyphens with a <wbr> tag might be sufficient.

All 5 comments

That is my bad. We are doing this to make long identifiers wrap naturally when the screen size gets narrow, or for very long columns.

I will investigate another way achieving this. Replacing soft hyphens with a <wbr> tag might be sufficient.

Same happened to me in https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.SecretsManagerSecretOptions.html#properties

Took a while to understand what's actually going on here:
Screenshot 2019-08-14 at 22 22 13

Turns out there is a zero-width space character between json and Field.

This is what it looks like in Firefox:
Screenshot 2019-08-14 at 22 24 13

@rix0rrr It doesn't look like this issue has been resolved if I look at https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html . Have the docs not been updated to reflect the change?

@rix0rrr Looks like the docs are updated now to using a <wbr> element, which seems to have resolved my previous issue, but now is causing those characters to show up in the text in some places. For example on https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-iam.PolicyStatement.html you can see the in the "Initializer" section the text new Policy<wbr>Statement as shown in the screenshot below.

Screen Shot 2019-08-23 at 7 27 45 PM

My preference would be for the docs to not care about word breaks. You can see here an example where the string ConstructNode breaks awkwardly currently, and that is totally fine. I'd much rather have the docs appear like this than have these hidden character tricks that are happening currently. https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketPolicy.html

Screen Shot 2019-08-24 at 8 13 23 AM

Was this page helpful?
0 / 5 - 0 ratings