Skip to content

Commit b82b9dd

Browse files
Merge pull request #1 from ethereumclassic/twitter_2_x
add x to regex check for quoteTweet
2 parents 62ab59e + e3e3cf3 commit b82b9dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/contribution/tweet/tweet.loader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function tweetConfig({
4242
quoteUrl: {
4343
type: "text",
4444
title: ({ decorated }) => `${decorated.quoteType?.markdown} URL`,
45-
placeholder: "e.g. https://twitter.com/[user]/status/[id]",
45+
placeholder: "e.g. https://x.com/[user]/status/[id]",
4646
transform: (value) => value.split("?")[0].trim(),
4747
iframe: (value) =>
4848
`https://twitframe.com/show?url=${encodeURIComponent(value)}`,
@@ -60,11 +60,11 @@ export default function tweetConfig({
6060
});
6161
}
6262
const regexPattern =
63-
/https:\/\/twitter\.com\/([\w]+)\/status\/(\d+)/;
63+
/https:\/\/(?:twitter\.com|x\.com)\/([\w]+)\/status\/(\d+)/;
6464
if (!text || !text.match(regexPattern)) {
6565
return ctx.createError({
6666
message:
67-
"Must match format https://twitter.com/[user]/status/[id]",
67+
"Must match format https://twitter.com/[user]/status/[id] or https://x.com/[user]/status/[id]",
6868
});
6969
}
7070
// TODO automatically transform this serverside for easier API usage?

0 commit comments

Comments
 (0)