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

Code listing style fixes, remove extra line management #667

Conversation

dobromir-hristov
Copy link
Contributor

@dobromir-hristov dobromir-hristov commented May 19, 2023

closes #662

rdar://109756906

Summary

This PR refactors the css styling of the CodeListing in order to properly render new lines coming from code.

Dependencies

Testing

This PR should be tested with as many examples as possible, across Tutorials and Doc pages.

We should test with scrollable content, multi-line content, and any combination of them.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests - css mostly
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@dobromir-hristov
Copy link
Contributor Author

@Kyle-Ye give this a try and let me know :)

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented May 22, 2023

@Kyle-Ye give this a try and let me know :)

Tried it. It seems to fix all the bug I know. Thanks

  • Missing new line in multi string swift code
  • Extra new line in tutorial
  • Proper new line copy behavior in tutorial.

Copy link
Contributor

@Kyle-Ye Kyle-Ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Looks like this fixes both the tutorial and multiple line literal issue, and I also wasn't able to find any obvious regressions with any other complicated code listing we might render, like API Changes, collapsible REST code listings, etc

🚀

Copy link
Member

@marinaaisa marinaaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and seems to look good now 💯

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov dobromir-hristov merged commit ca9f99e into swiftlang:main May 24, 2023
@dobromir-hristov dobromir-hristov deleted the dhristov/code-listing-style-fixes branch May 24, 2023 05:53
dobromir-hristov added a commit to dobromir-hristov/swift-docc-render that referenced this pull request May 24, 2023
* Fix extra empty line issue on tutorial

* refactor: change the CodeListing rendering

Co-authored-by: Kyle <[email protected]>
dobromir-hristov added a commit that referenced this pull request May 24, 2023
* Fix extra empty line issue on tutorial

* refactor: change the CodeListing rendering

Co-authored-by: Kyle <[email protected]>

rdar://109756906
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial extra empty line bug
4 participants