Skip to content

Commit 103f4db

Browse files
authored
Merge pull request #161 from Retsam/fix-link
fix: add % to playground link regex to allow url-encoded characters
2 parents 3d6589c + 2be6788 commit 103f4db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/codeBlocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getReferencedMessage } from './getReferencedMessage';
44

55
const CODEBLOCK_REGEX = /```(?:ts|typescript)?\n([\s\S]+)```/;
66

7-
export const PLAYGROUND_REGEX = /https?:\/\/(?:www\.)?(?:typescriptlang|staging-typescript)\.org\/(?:play|dev\/bug-workbench)(?:\/index\.html)?\/?(\??(?:\w+=[^\s#&]+)?(?:\&\w+=[^\s#&]+)*)#code\/([\w\-+_]+={0,4})/;
7+
export const PLAYGROUND_REGEX = /https?:\/\/(?:www\.)?(?:typescriptlang|staging-typescript)\.org\/(?:play|dev\/bug-workbench)(?:\/index\.html)?\/?(\??(?:\w+=[^\s#&]+)?(?:\&\w+=[^\s#&]+)*)#code\/([\w\-%+_]+={0,4})/;
88

99
export async function findCode(message: Message, ignoreLinks = false) {
1010
const codeInMessage = findCodeInMessage(message, ignoreLinks);

0 commit comments

Comments
 (0)