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: add anchor to regex for special msg replacement #1635

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/plugins/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ export const camelize = (str: string): string => {
}

export function formatConsoleMessage(message: string): string {
message = message.replace(/!! /g, '')
message = message.replace(/\/\/ /g, '')
// remove !! at error msg start
message = message.replace(/^!! /g, '')
// remove !! after \n new line
message = message.replace(/\n!! /g, '\n')
// remove // at command msg start
message = message.replace(/^\/\/ /g, '')
// remove // at \n new line
message = message.replace(/\n\/\/ /g, '\n')
// remove echo
message = message.replace(/^echo:/g, '')
message = message.replace(/^echo: /g, '')
// replace linebreaks with html <br>
message = message.replace('\n// ', '<br>')
message = message.replace(/\r\n|\r|\n/g, '<br>')
//message = message.replaceAll('<br />', '<br>')
//return message.split('<br>');

return message
}

Expand Down
Loading