We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0083617 commit dffea35Copy full SHA for dffea35
frontend/__tests__/unit/components/AnchorTitle.test.tsx
@@ -11,9 +11,9 @@ jest.mock('utils/slugify', () => ({
11
default: jest.fn((str: string) =>
12
str
13
.toLowerCase()
14
- .replace(/[^a-z0-9]/g, '-')
15
- .replace(/-{2,10}/g, '-')
16
- .replace(/(^-{1,10}|-{1,10}$)/g, '')
+ .replaceAll(/[^a-z0-9]/g, '-')
+ .replaceAll(/-{2,10}/g, '-')
+ .replaceAll(/(^-{1,10}|-{1,10}$)/g, '')
17
),
18
}))
19
@@ -652,9 +652,9 @@ describe('AnchorTitle Component', () => {
652
mockFn.mockImplementation((str: string) =>
653
654
655
656
657
658
)
659
660
const mockScrollTo = jest.spyOn(globalThis, 'scrollTo').mockImplementation()
frontend/__tests__/unit/components/MarkdownWrapper.test.tsx
@@ -11,8 +11,8 @@ jest.mock('markdown-it/index.mjs', () => {
render: (content: string) => {
// Very simple mock: replace **bold** and [link](url)
return content
- .replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
- .replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2">$1</a>')
+ .replaceAll(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
+ .replaceAll(/\[(.*?)\]\((.*?)\)/g, '<a href="$2">$1</a>')
},
use: jest.fn().mockReturnThis(),
frontend/__tests__/unit/pages/UserDetails.test.tsx
@@ -41,7 +41,7 @@ jest.mock('components/Badges', () => {
41
showTooltip?: boolean
42
}) => (
43
<div
44
- data-testid={`badge-${name.toLowerCase().replace(/\s+/g, '-')}`}
+ data-testid={`badge-${name.toLowerCase().replaceAll(/\s+/g, '-')}`}
45
data-css-class={cssClass}
46
data-show-tooltip={showTooltip}
47
>
frontend/src/app/board/[year]/candidates/page.tsx
@@ -189,7 +189,7 @@ const BoardCandidatesPage = () => {
189
190
const handleCardClick = () => {
191
// Convert name to slug format.
192
- const nameSlug = candidate.memberName.toLowerCase().replace(/\s+/g, '_')
+ const nameSlug = candidate.memberName.toLowerCase().replaceAll(/\s+/g, '_')
193
const candidateUrl = `https://owasp.org/www-board-candidates/${year}/${nameSlug}.html`
194
window.open(candidateUrl, '_blank', 'noopener,noreferrer')
195
}
@@ -295,7 +295,7 @@ const BoardCandidatesPage = () => {
295
296
className="text-gray-700 dark:text-gray-300"
297
298
- {candidate.member.bio.replace(/\n+/g, ' ').replace(/\s+/g, ' ').trim()}
+ {candidate.member.bio.replaceAll(/\n+/g, ' ').replaceAll(/\s+/g, ' ').trim()}
299
</div>
300
)}
301
frontend/src/components/Badges.tsx
@@ -16,7 +16,7 @@ const normalizeCssClass = (cssClass: string | undefined) => {
// Convert backend snake_case format to frontend camelCase format
- return cssClass.trim().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase())
+ return cssClass.trim().replaceAll(/_([a-z])/g, (_, letter) => letter.toUpperCase())
20
21
22
const resolveIcon = (cssClass: string | undefined) => {
frontend/src/components/BreadCrumbs.tsx
@@ -43,7 +43,7 @@ export default function BreadCrumbs() {
{segments.map((segment, index) => {
const href = homeRoute + segments.slice(0, index + 1).join(homeRoute)
- const label = upperFirst(segment).replace(/-/g, ' ')
+ const label = upperFirst(segment).replaceAll('-', ' ')
const isLast = index === segments.length - 1
48
49
return (
frontend/src/utils/slugify.ts
@@ -1,8 +1,8 @@
1
export default function slugify(text: string): string {
2
return text
3
.normalize('NFKD') // Normalize accented characters
4
- .replace(/[\u0300-\u036F]/g, '') // Remove diacritics
5
- .replace(/[^a-zA-Z0-9]+/g, '-') // Replace non-alphanumeric with hyphens
+ .replaceAll(/[\u0300-\u036F]/g, '') // Remove diacritics
+ .replaceAll(/[^a-zA-Z0-9]+/g, '-') // Replace non-alphanumeric with hyphens
6
.replace(/^[-]+/, '') // Trim leading hyphens
7
.replace(/[-]+$/, '') // Trim trailing hyphens
8
0 commit comments