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

Squish whitespace in Markdown #4324

Merged
merged 6 commits into from
Mar 25, 2024
Merged

Conversation

davep
Copy link
Contributor

@davep davep commented Mar 21, 2024

Collapse whitespace within the text of a markdown document when displaying it with Markdown. With this change multiple concurrent instances of space and tab are collapsed down to a single space.

Implements #4321.

@davep davep added enhancement New feature or request Task labels Mar 21, 2024
@davep davep self-assigned this Mar 21, 2024
@davep davep linked an issue Mar 21, 2024 that may be closed by this pull request
@willmcgugan
Copy link
Collaborator

Will this have any impact on code blocks, where you wouldn't want whitespace collapsed?

@davep
Copy link
Contributor Author

davep commented Mar 21, 2024

Will this have any impact on code blocks, where you wouldn't want whitespace collapsed?

Screenshot 2024-03-21 at 18 01 43

@davep davep marked this pull request as ready for review March 25, 2024 11:06
Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

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

Left two comments for your consideration but none of them are blocking.

src/textual/widgets/_markdown.py Outdated Show resolved Hide resolved
src/textual/widgets/_markdown.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

Suggestion re regexes

src/textual/widgets/_markdown.py Outdated Show resolved Hide resolved
davep and others added 2 commits March 25, 2024 11:29
@davep davep requested a review from willmcgugan March 25, 2024 11:40
Seems we're happy that \s along won't be too greedy.
@davep davep merged commit ea81389 into Textualize:main Mar 25, 2024
20 checks passed
@davep davep deleted the the-space-must-not-flow branch March 25, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple whitespaces shown in Markdown renders
3 participants