Skip to content

Commit

Permalink
doc: regex description
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stainbrook <[email protected]>
  • Loading branch information
rackrick committed Nov 1, 2023
1 parent 14d97f2 commit a96d6d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ export const camelize = (str: string): string => {
}

export function formatConsoleMessage(message: string): string {
// 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')
// replace linebreaks with html <br>
message = message.replace('\n// ', '<br>')
message = message.replace(/\r\n|\r|\n/g, '<br>')
return message
Expand Down

0 comments on commit a96d6d7

Please sign in to comment.