Skip to content

Conversation

manishsahanidev
Copy link
Contributor

Description

Fixes #28828

This PR addresses the issue where unnecessary whitespace is added between the label and input message in the prompt() function.

Changes

  • Modified the prompt() function to only add a space after the message if the message is non-empty
  • This ensures no extra whitespace appears when using an empty label

Before

  • With label: Statement: Example statement (extra space)
  • With empty label: Example statement (leading space)

After

  • With label: Statement: Example statement (single space)
  • With empty label: Example statement (no extra space)

Testing

Manually verified the behavior works correctly for both cases.

@CLAassistant
Copy link

CLAassistant commented Apr 12, 2025

CLA assistant check
All committers have signed the CLA.

@manishsahanidev manishsahanidev marked this pull request as draft April 14, 2025 15:12
@manishsahanidev manishsahanidev marked this pull request as ready for review April 14, 2025 15:12
Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@dsherret dsherret enabled auto-merge (squash) April 16, 2025 17:06
@dsherret dsherret merged commit 252ea8e into denoland:main Apr 16, 2025
18 checks passed
@manishsahanidev manishsahanidev deleted the fix-prompt-whitespace branch April 16, 2025 23:55
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.

Request: Make prompt() drop unneccessary whitespace between label and input message
3 participants