Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15766,7 +15766,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12570,7 +12570,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/checkAndroidStatus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -737313,7 +737313,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11837,7 +11837,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/checkSVGCompression/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20362,7 +20362,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12124,7 +12124,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/formatCodeCovComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12024,7 +12024,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function normalizeAlias(alias: string): string {
}

function toRoutePath(filename: string): string {
return filename.slice(DOCS_DIRECTORY_PREFIX.length).replace(/\.md$/, '');
return filename.slice(DOCS_DIRECTORY_PREFIX.length).replaceAll(/\.md$/g, '');
}

async function getUpdatedDocRoutes(octokit: OctokitClient, owner: string, repo: string, prNumber: number): Promise<string[]> {
Expand Down Expand Up @@ -61,7 +61,7 @@ async function run(): Promise<void> {
const routes = await getUpdatedDocRoutes(octokit, owner, repo, prNumber);
const normalizedRootURL = normalizeAlias(rootURL);

const displayRootURL = normalizedRootURL.replace(/\/$/, '');
const displayRootURL = normalizedRootURL.replaceAll(/\/$/g, '');
let body = `A preview of your ExpensifyHelp changes have been deployed to ${displayRootURL} ⚡️`;

if (routes.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/getArtifactInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11798,7 +11798,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12143,7 +12143,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/getPreviousVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11954,7 +11954,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11927,7 +11927,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12029,7 +12029,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11798,7 +11798,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13251,7 +13251,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11928,7 +11928,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/javascript/proposalPoliceComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12067,7 +12067,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down Expand Up @@ -12595,7 +12595,7 @@ function sanitizeJSONStringValues(inputString) {
// Function to recursively sanitize string values in an object
const sanitizeValues = (obj) => {
if (typeof obj === 'string') {
return obj.replace(/\\|\t|\n|\r|\f|"/g, replacer);
return obj.replaceAll(/\\|\t|\n|\r|\f|"/g, replacer);
}
if (Array.isArray(obj)) {
return obj.map((item) => sanitizeValues(item));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11808,7 +11808,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/javascript/reviewerChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11632,7 +11632,7 @@ function checkIssueForCompletedChecklist(numberOfChecklistItems) {
break;
}
const whitespace = /([\n\r])/gm;
const comment = combinedComments.at(i)?.replace(whitespace, '');
const comment = combinedComments.at(i)?.replaceAll(whitespace, '');
console.log(`Comment ${i} starts with: ${comment?.slice(0, 20)}...`);
// Found the reviewer checklist, so count how many completed checklist items there are
if (comment?.indexOf(reviewerChecklistContains) !== -1) {
Expand Down Expand Up @@ -11900,7 +11900,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function checkIssueForCompletedChecklist(numberOfChecklistItems: number) {
}

const whitespace = /([\n\r])/gm;
const comment = combinedComments.at(i)?.replace(whitespace, '');
const comment = combinedComments.at(i)?.replaceAll(whitespace, '');

console.log(`Comment ${i} starts with: ${comment?.slice(0, 20)}...`);

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/javascript/verifySignedCommits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11840,7 +11840,7 @@ class GithubUtils {
static getStagingDeployCashData(issue) {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');
return {
title: issue.title,
url: issue.url,
Expand Down
2 changes: 1 addition & 1 deletion .github/libs/GithubUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class GithubUtils {
static getStagingDeployCashData(issue: OctokitIssueItem): StagingDeployCashData {
try {
const versionRegex = new RegExp('([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9]+))?', 'g');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replace(/`/g, '');
const version = (issue.body?.match(versionRegex)?.[0] ?? '').replaceAll('`', '');

return {
title: issue.title,
Expand Down
2 changes: 1 addition & 1 deletion .github/libs/sanitizeJSONStringValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function sanitizeJSONStringValues(inputString: string): string {
// Function to recursively sanitize string values in an object
const sanitizeValues = (obj: unknown): unknown => {
if (typeof obj === 'string') {
return obj.replace(/\\|\t|\n|\r|\f|"/g, replacer);
return obj.replaceAll(/\\|\t|\n|\r|\f|"/g, replacer);
}
if (Array.isArray(obj)) {
return obj.map((item) => sanitizeValues(item));
Expand Down
2 changes: 1 addition & 1 deletion .github/libs/sanitizeStringForJSONParse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const sanitizeStringForJSONParse = (inputString: string | number | boolean | nul
}

// Replace any newlines and escape backslashes
return inputString.replace(/\\|\t|\n|\r|\f|"/g, replacer);
return inputString.replaceAll(/\\|\t|\n|\r|\f|"/g, replacer);
};

export default sanitizeStringForJSONParse;
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
"electron-builder": "26.0.19",
"eslint": "^9.36.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-expensify": "2.0.97",
"eslint-config-expensify": "2.0.98",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jsdoc": "^60.7.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/generateTranslations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ class TranslationGenerator {
let keyBase = node
.getText()
.trim()
.replace(/^['"`]/, '')
.replace(/['"`]$/, '');
.replaceAll(/^['"`]/g, '')
.replaceAll(/['"`]$/g, '');

const context = this.getContextForNode(node);
if (context) {
Expand Down
2 changes: 1 addition & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3724,7 +3724,7 @@ const CONST = {
return new RegExp(this.EMOJIS, this.EMOJIS.flags.concat('g'));
},

MERGED_ACCOUNT_PREFIX: /^(MERGED_\d+@)/,
MERGED_ACCOUNT_PREFIX: /^(MERGED_\d+@)/g,
ROUTES: {
VALIDATE_LOGIN: /\/v($|(\/\/*))/,
UNLINK_LOGIN: /\/u($|(\/\/*))/,
Expand Down
12 changes: 6 additions & 6 deletions src/components/AddPaymentCard/PaymentCardForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function PaymentCardForm({
return;
}

let value = newValue.replace(CONST.REGEX.NON_NUMERIC, '');
let value = newValue.replaceAll(CONST.REGEX.NON_NUMERIC, '');

if (value.length === 1) {
const firstDigit = value.charAt(0);
Expand All @@ -163,7 +163,7 @@ function PaymentCardForm({
}
}

const prevValue = previousValueRef.current?.replace(CONST.REGEX.NON_NUMERIC, '') ?? '';
const prevValue = previousValueRef.current?.replaceAll(CONST.REGEX.NON_NUMERIC, '') ?? '';
let formattedValue = value;

if (value.length === 2 && prevValue.length < 2) {
Expand All @@ -185,7 +185,7 @@ function PaymentCardForm({
errors.nameOnCard = translate(label.error.nameOnCard);
}

if (values.cardNumber && !isValidDebitCard(values.cardNumber.replace(/ /g, ''))) {
if (values.cardNumber && !isValidDebitCard(values.cardNumber.replaceAll(' ', ''))) {
errors.cardNumber = translate(label.error.cardNumber);
}

Expand Down Expand Up @@ -225,21 +225,21 @@ function PaymentCardForm({

const onChangeCardNumber = useCallback((newValue: string) => {
// Replace all characters that are not spaces or digits
let validCardNumber = newValue.replace(/[^\d ]/g, '');
let validCardNumber = newValue.replaceAll(/[^\d ]/g, '');

// Gets only the first 16 digits if the inputted number have more digits than that
validCardNumber = validCardNumber.match(/(?:\d *){1,16}/)?.[0] ?? '';

// Remove all spaces to simplify formatting
const cleanedNumber = validCardNumber.replace(/ /g, '');
const cleanedNumber = validCardNumber.replaceAll(' ', '');

// Check if the number is a potential Amex card (starts with 34 or 37 and has up to 15 digits)
const isAmex = /^3[47]\d{0,13}$/.test(cleanedNumber);

// Format based on Amex or standard 4-4-4-4 pattern
if (isAmex) {
// Format as 4-6-5 for Amex
validCardNumber = cleanedNumber.replace(/(\d{1,4})(\d{1,6})?(\d{1,5})?/, (match, p1, p2, p3) => [p1, p2, p3].filter(Boolean).join(' '));
validCardNumber = cleanedNumber.replaceAll(/(\d{1,4})(\d{1,6})?(\d{1,5})?/g, (match, p1, p2, p3) => [p1, p2, p3].filter(Boolean).join(' '));
} else {
// Format as 4-4-4-4 for non-Amex
validCardNumber = cleanedNumber.match(/.{1,4}/g)?.join(' ') ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function BaseAnchorForCommentsOnly({
linkProps.href = href;
}
const defaultTextStyle = canUseTouchScreen() || shouldUseNarrowLayout ? {} : {...styles.userSelectText, ...styles.cursorPointer};
const isEmail = Str.isValidEmail(href.replace(/mailto:/i, ''));
const isEmail = Str.isValidEmail(href.replaceAll(/mailto:/gi, ''));
const linkHref = !linkHasImage ? href : undefined;
const isFocused = useIsFocused();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
textInputLabel={translate('yearPickerPage.selectYear')}
textInputValue={searchText}
textInputMaxLength={4}
onChangeText={(text) => setSearchText(text.replace(CONST.REGEX.NON_NUMERIC, '').trim())}
onChangeText={(text) => setSearchText(text.replaceAll(CONST.REGEX.NON_NUMERIC, '').trim())}
inputMode={CONST.INPUT_MODE.NUMERIC}
headerMessage={headerMessage}
sections={sections}
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnvironmentContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const EnvironmentContext = createContext<EnvironmentContextValue>({
function EnvironmentProvider({children}: EnvironmentProviderProps): ReactElement {
const [environment, setEnvironment] = useState<EnvironmentValue>(CONST.ENVIRONMENT.PRODUCTION);
const [environmentURL, setEnvironmentURL] = useState(CONST.NEW_EXPENSIFY_URL);
const [environmentURLWithoutTrailingSlash] = useMemo(() => [environmentURL.replace(/\/+$/, '')], [environmentURL]);
const [environmentURLWithoutTrailingSlash] = useMemo(() => [environmentURL.replaceAll(/\/+$/g, '')], [environmentURL]);

useEffect(() => {
getEnvironment().then(setEnvironment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {AttachmentContext} from '@components/AttachmentContext';
import {getButtonRole} from '@components/Button/utils';
import {isDeletedNode} from '@components/HTMLEngineProvider/htmlEngineUtils';
import {Document, GalleryNotFound} from '@components/Icon/Expensicons';

Check failure on line 6 in src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check failure on line 6 in src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import PressableWithoutFocus from '@components/Pressable/PressableWithoutFocus';
import {ShowContextMenuContext, showContextMenuForReport} from '@components/ShowContextMenuContext';
import ThumbnailImage from '@components/ThumbnailImage';
Expand Down Expand Up @@ -56,7 +56,7 @@
// The backend always returns these thumbnails with a .jpg extension, even for .png images.
// As a workaround, we remove the .1024.jpg or .320.jpg suffix only for .png images,
// For other image formats, we retain the thumbnail as is to avoid unnecessary modifications.
const processedPreviewSource = typeof previewSource === 'string' ? previewSource.replace(/\.png\.(1024|320)\.jpg$/, '.png') : previewSource;
const processedPreviewSource = typeof previewSource === 'string' ? previewSource.replaceAll(/\.png\.(1024|320)\.jpg$/g, '.png') : previewSource;
const source = tryResolveUrlFromApiRoot(isAttachmentOrReceipt ? attachmentSourceAttribute : htmlAttribs.src);

const alt = htmlAttribs.alt;
Expand Down
Loading
Loading