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

fix: Cypress interprets underscores in URL as formatting instructions on frontend #28245

Closed
wants to merge 4 commits into from

Conversation

Crustum7
Copy link
Contributor

@Crustum7 Crustum7 commented Nov 5, 2023

Additional details

The app should display urls in raw form instead of markdown to avoid being misleading.

Steps to test

How has the user experience changed?

The app shows "visit __bankTransfers__" instead of "visit: bankTransfers" when trying to visit __bankTransfers__.
image
Before
image
After

PR Tasks

@cypress-app-bot
Copy link
Collaborator

@@ -38,7 +38,8 @@ export const formattedMessage = (message: string) => {
const matchingText = searchText.find((text) => message.includes(text))
const textToConvert = [split[0].trim(), ...(matchingText ? [matchingText] : [])].join(' ')
const spaceEscapedText = textToConvert.replace(/^ +/gm, (initialSpaces) => ' '.repeat(initialSpaces.length)) // &#32 is the HTML entity for a space
const converted = md.renderInline(spaceEscapedText)
const underscorePreservedText = spaceEscapedText.replace(/_+/gm, (initialUnderscores) => '_'.repeat(initialUnderscores.length)) // &#32 HTML entity for underscore
const converted = md.renderInline(underscorePreservedText)
Copy link
Member

Choose a reason for hiding this comment

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

can we add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated one of the existing tests and added a clarifying comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@emilyrohrbough could you check out my PR #27934? I feel like it is ready to be merged

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.

Cypress interprets underscores in URL as formatting instructions on frontend
3 participants