From 5b103644d1168166d8bd474e46177107bfa0638d Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Thu, 3 Sep 2026 20:54:33 +0000 Subject: [PATCH 1/2] Add BiDi text support via dir="auto" attribute This ensures that bidirectional text (like Arabic or Hebrew filenames) is rendered correctly when it's part of the top directory name or the file listing. --- .jules/palette.md | 3 +++ src/main/kotlin/html4tree/main.kt | 8 ++++---- .../kotlin/html4tree/GeneratedIndexReadabilityTest.kt | 4 ++-- src/test/kotlin/html4tree/MainTest.kt | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.jules/palette.md b/.jules/palette.md index 604d7810..942003e7 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -73,3 +73,6 @@ ## 2026-08-17 - 브라우저 번역과 화면 판독기의 호환성을 위한 텍스트 처리 **Learning:** `aria-label` 속성으로 지정된 화면 판독기용 대체 텍스트는 Chrome Translate 등 브라우저 번역 도구에 의해 번역되지 않는 경우가 많습니다. 이로 인해 문서 언어가 변환되어도 스크린 리더에서는 원본 언어(예: 영어)로 읽혀 다국어 접근성이 저하됩니다. **Action:** 화면 판독기를 위한 숨겨진 설명 텍스트를 제공할 때 `aria-label` 대신 CSS `.visually-hidden` 클래스를 적용한 `` 요소를 사용하여, 브라우저가 일반 텍스트로 인식하고 번역할 수 있도록 하여 다국어 접근성 호환성을 확보하십시오. +## 2024-08-20 - RTL 문자열이 포함된 파일명을 위한 양방향(BiDi) 텍스트 지원 +**Learning:** 파일 서버는 다국어 파일 및 폴더명을 지원해야 하지만, 오른쪽에서 왼쪽으로 쓰는(Right-To-Left) 문자가 포함된 이름이 일반적인 LTR 레이아웃에 표시될 때 텍스트 렌더링이 깨지거나 레이아웃 방향이 잘못 설정되는 문제가 발생할 수 있습니다. +**Action:** 폴더나 파일명 등 사용자 생성 텍스트가 표시되는 구체적인 텍스트 노드(`

` 및 파일명을 감싸는 `` 태그)에 `dir="auto"` 속성을 명시하여 텍스트 내용에 맞게 방향성이 자동으로 처리되도록 개선하십시오. diff --git a/src/main/kotlin/html4tree/main.kt b/src/main/kotlin/html4tree/main.kt index 0972fa2c..f4f2946a 100644 --- a/src/main/kotlin/html4tree/main.kt +++ b/src/main/kotlin/html4tree/main.kt @@ -426,10 +426,10 @@ fun process_dir(curr_dir: File, excludeSet: Set? = null, dirFiles: Array
-

${directoryName.escapeHtml()}

+

${directoryName.escapeHtml()}