You can see that it’s converted the multi-line JSON string into a single line, full of newline escapes, which is completely unreadable, and changes the example from being a good example to a bad one.
The strange thing is, the same thing doesn’t seem to happen for a similar official orb.
Original: https://github.com/CircleCI-Public/slack-orb/blob/v4.0.1/src/examples/custom_notification.yml#L17-L31
Result: https://circleci.com/developer/orbs/orb/circleci/slack?version=4.0.1#usage-custom_notification
I inspected the circleci/slack orb source with circleci orb source circleci/slack@4.0.1 and tried a couple of things based on that:
and republishing the orb before taking more drastic steps.
Taking a look at your orb, I can see that you are using the older orb format. If upgrading your local CircleCI CLI does not fix this, I recommend using the CircleCI Orb Developer Kit to jump start the transition to the new orb format: https://circleci.com/docs/2.0/orb-author/#orb-development-kit
The new format includes the “examples” folder, in which you explicitly define the examples that are shown on the developer hub. I initially had the feeling that the newline characters are being placed as a result of your examples being auto-generated, but for some reason this wasn’t the case for Mike’s fork of your repository. Perhaps when you explicitly define the examples, this circumvents the issue that causes the newline characters to be added.
Please keep us up to date on whether it happened to be an out-dated CLI or if declaring the examples yourself using new new orb format fixes this!