-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
|
@@ -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)) //   is the HTML entity for a space | |||
const converted = md.renderInline(spaceEscapedText) | |||
const underscorePreservedText = spaceEscapedText.replace(/_+/gm, (initialUnderscores) => '_'.repeat(initialUnderscores.length)) //   HTML entity for underscore | |||
const converted = md.renderInline(underscorePreservedText) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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__
.Before
After
PR Tasks
cypress-documentation
?type definitions
?