Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLeitwolf112026-11-10 02:11:15 +0300
committerLeitwolf112026-11-10 02:11:15 +0300
commita4230a3fee22fba0a12c66051829c2ca0e9c7092 (patch)
tree676ba8d1954b01bf67533fb76bda83da6b0c8efa
parent05e5146aa898ecdd968cf6c27def7523d80204cf (diff)
downloadtazel.net-a4230a3fee22fba0a12c66051829c2ca0e9c7092.tar.gz
Write the Hebrew direction marks as escapes and tidy the search
Codacy read the right-to-left marks (U+200F) in the Hebrew strings of home.ts and chrome.ts as a possible trojan-source attack. They keep a Latin word at the start of a Hebrew sentence in its place, so they stay, written as \u200F escapes; the rendered text is unchanged (checked in the generated Hebrew page). The search box drops its two non-null assertions and the arrow functions that returned addEventListener. Tests, nuxt typecheck and Prettier pass; a Hebrew search returns sections and Enter opens one.
-rw-r--r--app/components/SiteSearch.vue15
-rw-r--r--app/content/chrome.ts2
-rw-r--r--app/content/home.ts18
3 files changed, 20 insertions, 15 deletions
diff --git a/app/components/SiteSearch.vue b/app/components/SiteSearch.vue
index 391542c..fb86d80 100644
--- a/app/components/SiteSearch.vue
+++ b/app/components/SiteSearch.vue
@@ -43,7 +43,7 @@ const results = computed(() => {
const text = section.content.toLocaleLowerCase();
if (!words.every((word) => heading.includes(word) || text.includes(word))) return null;
const score = words.filter((word) => heading.includes(word)).length;
- const at = text.indexOf(words[0]!);
+ const at = text.indexOf(words[0] ?? "");
const excerpt =
at < 0
? section.content.slice(0, 110)
@@ -77,8 +77,9 @@ function onKey(event: KeyboardEvent) {
} else if (event.key === "ArrowUp" && count) {
active.value = (active.value - 1 + count) % count;
event.preventDefault();
- } else if (event.key === "Enter" && count) {
- go(results.value[active.value]!.section.id);
+ } else if (event.key === "Enter") {
+ const chosen = results.value[active.value];
+ if (chosen) go(chosen.section.id);
} else if (event.key === "Escape") {
open.value = false;
input.value?.blur();
@@ -93,8 +94,12 @@ function onShortcut(event: KeyboardEvent) {
}
}
-onMounted(() => window.addEventListener("keydown", onShortcut));
-onBeforeUnmount(() => window.removeEventListener("keydown", onShortcut));
+onMounted(() => {
+ window.addEventListener("keydown", onShortcut);
+});
+onBeforeUnmount(() => {
+ window.removeEventListener("keydown", onShortcut);
+});
</script>
<template>
diff --git a/app/content/chrome.ts b/app/content/chrome.ts
index 8241bd8..6a84385 100644
--- a/app/content/chrome.ts
+++ b/app/content/chrome.ts
@@ -150,7 +150,7 @@ export const chrome: Record<Locale, Chrome> = {
issues: "דיווח על בעיה",
changelog: "יומן שינויים",
license: "רישיון",
- notice: "‏Tazel היא תוכנה חופשית תחת MPL-2.0 עם Progmasoft Exception 2.0.",
+ notice: "\u200FTazel היא תוכנה חופשית תחת MPL-2.0 עם Progmasoft Exception 2.0.",
contact: "יצירת קשר",
},
docsNav: {
diff --git a/app/content/home.ts b/app/content/home.ts
index 93c2e8f..f6bba92 100644
--- a/app/content/home.ts
+++ b/app/content/home.ts
@@ -214,10 +214,10 @@ export const home: Record<Locale, HomeText> = {
"he-IL": {
title: "Tazel — מערכת בנייה ומנהל חבילות",
description:
- "‏Tazel בונה, מריצה ובודקת פרויקטים מקובץ פרויקט אחד ב-Kotlin, ושומרת את התלויות שלהם בקובץ נעילה. את Tala היא בונה עם Talac, ושפות אחרות, כמו C ו-C++, דרך תוספים.",
+ "\u200FTazel בונה, מריצה ובודקת פרויקטים מקובץ פרויקט אחד ב-Kotlin, ושומרת את התלויות שלהם בקובץ נעילה. את Tala היא בונה עם Talac, ושפות אחרות, כמו C ו-C++, דרך תוספים.",
eyebrow: "מערכת בנייה ומנהל חבילות",
headline: "קובץ פרויקט אחד. פקודה אחת לכל משימה.",
- lead: "‏Tazel קוראת קובץ פרויקט ב-Kotlin, מריצה כל צעד של הבנייה כגרף אחד ורושמת כל תלות בקובץ נעילה. יעדי Tala מהודרים עם Talac; תוספים בונים שפות אחרות, כמו C ו-C++ עם Progmasoft.CC או פרויקט CMake עם Progmasoft.CMake.",
+ lead: "\u200FTazel קוראת קובץ פרויקט ב-Kotlin, מריצה כל צעד של הבנייה כגרף אחד ורושמת כל תלות בקובץ נעילה. יעדי Tala מהודרים עם Talac; תוספים בונים שפות אחרות, כמו C ו-C++ עם Progmasoft.CC או פרויקט CMake עם Progmasoft.CMake.",
start: "פרויקט ראשון",
commands: "פקודות",
featuresHeading: "מה Tazel עושה",
@@ -225,7 +225,7 @@ export const home: Record<Locale, HomeText> = {
features: [
{
title: "קובץ פרויקט ב-Kotlin",
- text: "קובץ הפרויקט הוא סקריפט Kotlin עם DSL בעל טיפוסים, כך שעורך משלים ובודק אותו. שמו BUILD.kts, ‏BUILD.tzl, ‏BUILD.tazel, ‏BUILD או Tazel.build; ‏Tazel מריצה אותו במארח הסקריפטים שלה, וכל מה שמחשב צריך הוא JRE 25.",
+ text: "קובץ הפרויקט הוא סקריפט Kotlin עם DSL בעל טיפוסים, כך שעורך משלים ובודק אותו. שמו BUILD.kts, \u200FBUILD.tzl, \u200FBUILD.tazel, \u200FBUILD או Tazel.build; \u200FTazel מריצה אותו במארח הסקריפטים שלה, וכל מה שמחשב צריך הוא JRE 25.",
},
{
title: "רק מה שהשתנה",
@@ -233,7 +233,7 @@ export const home: Record<Locale, HomeText> = {
},
{
title: "המחשב כולו",
- text: "צעדי תוספים, הידורים וחבילות בדיקה הם יחידות בגרף אחד ורצים זה לצד זה. ‎--jobs, ‏‎--cpus ו-‎--memory קובעים את הגבולות, ו-‎--profile כותב עקבה.",
+ text: "צעדי תוספים, הידורים וחבילות בדיקה הם יחידות בגרף אחד ורצים זה לצד זה. ‎--jobs, \u200F‎--cpus ו-‎--memory קובעים את הגבולות, ו-‎--profile כותב עקבה.",
},
{
title: "מטמון ובנייה מרחוק",
@@ -241,11 +241,11 @@ export const home: Record<Locale, HomeText> = {
},
{
title: "קובץ נעילה קריא",
- text: "‏LOCK.sqlite3 רושם במה הפרויקט תלוי, ‏LOCK.dump כותב זאת כטקסט לסקירה, ו-tazel lock graph מראה מי משתמש במה.",
+ text: "\u200FLOCK.sqlite3 רושם במה הפרויקט תלוי, \u200FLOCK.dump כותב זאת כטקסט לסקירה, ו-tazel lock graph מראה מי משתמש במה.",
},
{
title: "תוספים ב-Kotlin",
- text: "תוסף הוא JAR, מקומי או מ-ViGet, שמוסיף בלוקים לקובץ הפרויקט וצעדים לבנייה, כמו cc { } עבור C ו-C++. ‏Tazel בודקת את המתאר שלו ואת ה-SHA-256 שלו לפני שהיא טוענת אותו.",
+ text: "תוסף הוא JAR, מקומי או מ-ViGet, שמוסיף בלוקים לקובץ הפרויקט וצעדים לבנייה, כמו cc { } עבור C ו-C++. \u200FTazel בודקת את המתאר שלו ואת ה-SHA-256 שלו לפני שהיא טוענת אותו.",
},
],
stepsHeading: "מקובץ פרויקט לתוכנית",
@@ -256,18 +256,18 @@ export const home: Record<Locale, HomeText> = {
},
{
title: "לבנות",
- text: "‏tazel build מריצה את הצעדים של התוספים, מהדרת את יעדי Tala עם Talac וכותבת את התוכנית ל-build/debug או ל-build/release.",
+ text: "\u200Ftazel build מריצה את הצעדים של התוספים, מהדרת את יעדי Tala עם Talac וכותבת את התוכנית ל-build/debug או ל-build/release.",
},
{
title: "להריץ ולבדוק",
- text: "‏tazel run בונה קובץ הרצה אחד ומפעילה אותו; ‏tazel test בונה ומריצה את חבילות הבדיקה.",
+ text: "\u200Ftazel run בונה קובץ הרצה אחד ומפעילה אותו; \u200Ftazel test בונה ומריצה את חבילות הבדיקה.",
},
],
sampleHeading: "כל פרויקט מתחיל באותה דרך",
sampleLead: "כמה שורות נותנות שם לפרויקט ולתוכנית שלו; הבנייה השנייה לא מוצאת מה לעשות.",
closingHeading: "תוכנה חופשית, שמפותחת בגלוי",
closingText:
- "קוד המקור של Tazel, הבעיות והגרסאות שלו נמצאים ב-GitHub. ‏Talac, ‏talafmt ו-talalint הן תוכניות נפרדות עם גרסאות משלהן; פרויקט צריך אותן רק ליעדי Tala.",
+ "קוד המקור של Tazel, הבעיות והגרסאות שלו נמצאים ב-GitHub. \u200FTalac, \u200Ftalafmt ו-talalint הן תוכניות נפרדות עם גרסאות משלהן; פרויקט צריך אותן רק ליעדי Tala.",
closingAction: "Tazel ב-GitHub",
},
};