feat: 本地轉檔層補 .pptx——CP B1 最後一個 Office 格式
同 docx 路數:zip 開 OOXML、slide 按數字序、每頁「## 投影片 N」+文字+(備註); 空/純圖回 ErrNoText 明示不靜默。測試 4 案(中文/多頁排序/備註/空簡報)。 過程紅測一輪:NFKC 套整份 Markdown 把自家全形標籤「(備註)」轉半形—— 改為只正規化 XML 抽出片段、結構標記正規化後組裝。collector go test 全綠(總管親跑)。 (實作=子 CC;驗證+commit=總管)
This commit is contained in:
@@ -102,12 +102,12 @@ func TestWiring_抽不出文字要明確失敗不靜默(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// 還沒支援的格式(例如 .pptx 目前沒抽取器)要回 ErrUnsupported,
|
||||
// 不支援的格式(例如 .ppt 舊式二進位格式)要回 ErrUnsupported,
|
||||
// 訊息要跟「掃描件」區分開——給用戶的說法不同。
|
||||
func TestWiring_未支援格式與無文字要能區分(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
rel := "簡報.pptx"
|
||||
os.WriteFile(filepath.Join(dir, rel), []byte("PK\x03\x04fake"), 0o644)
|
||||
rel := "簡報.ppt"
|
||||
os.WriteFile(filepath.Join(dir, rel), []byte("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1fake"), 0o644)
|
||||
|
||||
_, err := ExtractWithGemma("fake-key-for-test", "", dir, rel)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user