mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
fix: multiple imports and other minor issues
This commit is contained in:
@@ -15,10 +15,9 @@ import { EditGameModal, DeleteReviewModal } from "./modals";
|
||||
import { ReviewSortOptions } from "./review-sort-options";
|
||||
import { ReviewPromptBanner } from "./review-prompt-banner";
|
||||
|
||||
import { sanitizeHtml } from "@shared";
|
||||
import { sanitizeHtml, AuthPage } from "@shared";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { cloudSyncContext, gameDetailsContext } from "@renderer/context";
|
||||
import { AuthPage } from "@shared";
|
||||
|
||||
import cloudIconAnimated from "@renderer/assets/icons/cloud-animated.gif";
|
||||
import { useUserDetails, useLibrary, useDate } from "@renderer/hooks";
|
||||
|
||||
@@ -3,7 +3,7 @@ function removeZalgoText(text: string): string {
|
||||
// eslint-disable-next-line no-misleading-character-class
|
||||
/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/g;
|
||||
|
||||
return text.replace(zalgoRegex, "");
|
||||
return text.replaceAll(zalgoRegex, "");
|
||||
}
|
||||
|
||||
function decodeHtmlEntities(text: string): string {
|
||||
@@ -16,7 +16,7 @@ function decodeHtmlEntities(text: string): string {
|
||||
" ": " ",
|
||||
};
|
||||
|
||||
return text.replace(/&[#\w]+;/g, (entity) => {
|
||||
return text.replaceAll(/&[#\w]+;/g, (entity) => {
|
||||
return entityMap[entity] || entity;
|
||||
});
|
||||
}
|
||||
@@ -25,9 +25,7 @@ function removeHtmlTags(html: string): string {
|
||||
let result = "";
|
||||
let inTag = false;
|
||||
|
||||
for (let i = 0; i < html.length; i++) {
|
||||
const char = html[i];
|
||||
|
||||
for (const char of html) {
|
||||
if (char === "<") {
|
||||
inTag = true;
|
||||
} else if (char === ">") {
|
||||
@@ -51,7 +49,7 @@ export function sanitizeHtml(html: string): string {
|
||||
|
||||
cleanText = removeZalgoText(cleanText);
|
||||
|
||||
cleanText = cleanText.replace(/\s+/g, " ").trim();
|
||||
cleanText = cleanText.replaceAll(/\s+/g, " ").trim();
|
||||
|
||||
if (!cleanText || cleanText.length === 0) {
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user