Skip to content

Compress 3 spaces down to 2 #444

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

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Compress 3 spaces down to 2 #444

merged 1 commit into from
Jan 29, 2025

Conversation

vcarl
Copy link
Member

@vcarl vcarl commented Jan 29, 2025

I spotted a weirdo formatted post that used spaces to emulate bullet points, which is bananas, but it also broke the markdown formatter. Discord doesn't support the 4-spaces-for-code markdown format, so this is fine.

Copy link

what-the-diff bot commented Jan 29, 2025

PR Summary

  • Implementation of a New Function - 'compressSpaces'
    A new function named compressSpaces has been introduced in the string helper module. Its primary role is to eliminate excessive spacing in text data by replacing any sequence of three or more spaces with just two spaces. This function will repeatedly perform this action until no more sequences of excessive spaces exist.

  • Updating Import Statements in 'server.ts'
    The import statements in the src/server.ts file have been updated to include the newly created compressSpaces function from the string helper module.

  • Enhancements in the 'renderPost' Function
    The processing of post.description in the renderPost function (in src/server.ts) has been improved. Now, before rendering the post description, the function first compresses any excessive spaces using the newly included compressSpaces function, and then it compresses line breaks. This streamlining in processing will result in cleaner, more comprehensible post descriptions.

@vcarl vcarl merged commit 4bc94c1 into main Jan 29, 2025
2 checks passed
@vcarl vcarl deleted the vc-spaces branch January 29, 2025 00:54
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.

1 participant