fix(seo): تطبیق کلمه کلیدی بیتوجه به بزرگ/کوچکی حروف
This commit is contained in:
@@ -23,7 +23,9 @@ export function useSeoChecks(input: SeoInput): Check[] {
|
|||||||
const text = docToText(input.body)
|
const text = docToText(input.body)
|
||||||
const words = text.split(/\s+/).filter(Boolean)
|
const words = text.split(/\s+/).filter(Boolean)
|
||||||
const kp = input.keyphrase.trim()
|
const kp = input.keyphrase.trim()
|
||||||
const has = (s: string, needle: string) => s.includes(needle)
|
// تطبیق کلمه کلیدی بیتوجه به بزرگ/کوچکی حروف — و نرمالسازی عربی/فارسی
|
||||||
|
const norm = (s: string) => s.toLowerCase().replace(/ي/g, 'ی').replace(/ك/g, 'ک')
|
||||||
|
const has = (s: string, needle: string) => norm(s).includes(norm(needle))
|
||||||
const checks: Check[] = []
|
const checks: Check[] = []
|
||||||
|
|
||||||
// عنوان
|
// عنوان
|
||||||
|
|||||||
Reference in New Issue
Block a user