Skip to content

Commit

Permalink
Tidy regex to capture filename
Browse files Browse the repository at this point in the history
  • Loading branch information
pzaback committed Apr 19, 2024
1 parent 7e0b4e4 commit b82ccb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/commands/slash/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function asBasicISOString(date: Date): string {
}

function reformatCodeBlocks(msgText: string): string {
const codeBlockRegex = /```(.*?\.(\w+)\s*.*)\n/g;
const codeBlockRegex = /```((.*?\.(\w+))\s*.*)\n/g;

return msgText.replace(codeBlockRegex,
(match, metadata, filename, extension) => {
Expand Down

0 comments on commit b82ccb7

Please sign in to comment.