mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
fix(api): 🐛 Fix regression in emoji parsing caused by incorrectly changed regex
This commit is contained in:
parent
c6c92e716f
commit
8e5d68144c
3 changed files with 49 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { emojiValidator } from "@api";
|
||||
import { emojiValidator, emojiValidatorWithColons } from "@api";
|
||||
import { proxyUrl } from "@response";
|
||||
import { type InferSelectModel, and, eq } from "drizzle-orm";
|
||||
import type * as Lysand from "lysand-types";
|
||||
|
|
@ -17,7 +17,7 @@ export type EmojiWithInstance = InferSelectModel<typeof Emojis> & {
|
|||
* @returns An array of emojis
|
||||
*/
|
||||
export const parseEmojis = async (text: string) => {
|
||||
const matches = text.match(emojiValidator);
|
||||
const matches = text.match(emojiValidatorWithColons);
|
||||
if (!matches) return [];
|
||||
const emojis = await db.query.Emojis.findMany({
|
||||
where: (emoji, { eq, or }) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue