Skip to content

Commit a8d1b6c

Browse files
committed
allow an optional language code in playground URLs
1 parent 77a7726 commit a8d1b6c

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|js|javascript)?\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\/(?:[a-z]{2,3}\/)?(?: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 = await findCodeInMessage(message, ignoreLinks);

0 commit comments

Comments
 (0)