fix(parser): detect iOS <attached: media messages#76
Conversation
- Add date pattern to recognize YYYY/MM/DD, HH:MM AM/PM format - Fixes issue #69 where Asian format with 12-hour time was not recognized - Add parser test case for the YYYY/MM/DD AM/PM format - Update parser tests README with format documentation
## [1.29.3](v1.29.2...v1.29.3) (2026-03-03) ### Bug Fixes * add support for YYYY/MM/DD format with 12-hour AM/PM time ([4223d81](4223d81)), closes [#69](#69)
There was a problem hiding this comment.
Pull request overview
This PR fixes a parser bug where iOS WhatsApp export lines using the <attached: filename.ext> format were not being recognized as media messages, causing them to render as plain text instead of being linked and playable. The fix adds the <attached: prefix to the existing MEDIA_INDICATORS list, which is already used with a prefix/substring match, so the change correctly handles any <attached: …> content. A parser test fixture and README documentation update are also included.
Changes:
- Added
'<attached:'toMEDIA_INDICATORSinchat-parser.tsso iOS-format media lines are correctly flagged as media messages - Added
examples/parser-tests/ios-attached-media-test.txtas a sample fixture containing iOS<attached:>lines for both audio and image - Updated
examples/parser-tests/README.mdto document the new iOS<attached:>indicator under "Media Indicators Supported"
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/lib/parser/chat-parser.ts |
Adds '<attached:' to MEDIA_INDICATORS to detect iOS-style attached media lines |
examples/parser-tests/ios-attached-media-test.txt |
New fixture with iOS <attached:> messages (audio + image) for manual testing |
examples/parser-tests/README.md |
Documents the new <attached:> media indicator in the supported indicators list |
|
@copilot open a new pull request to apply changes based on the comments in this thread Lint and build before finishing. |
|
@rodrigogs I've opened a new pull request, #77, to work on those changes. Once the pull request is ready, I'll request review from you. |
| '<媒体省略>', | ||
| '<미디어 생략>', | ||
| '<Медиа пропущены>', | ||
| '<attached:', |
There was a problem hiding this comment.
The PR description states "Closes #75", but issue #75 is about voice transcription (Whisper), not about iOS <attached: media messages. This appears to be the wrong issue number referenced. If there is a separate issue tracking the <attached: iOS media bug, the correct issue number should be used. If there is no separate issue, the "Closes #75" reference should be removed from the PR description, as it will incorrectly close an unrelated issue upon merge.
Add 41 iOS media indicator variants covering 30+ languages, sourced from WhatsApp Localizable.strings (v22.24.81, key zQ+5d). Includes fullwidth colon variants for Chinese and Japanese exports.
410e369 to
0d3ac4c
Compare
|
Merged to main as v1.29.4. |
Summary
<attached:toMEDIA_INDICATORSLocalizable.strings(v22.24.81, keyzQ+5d)examples/parser-testsWhy
iOS WhatsApp exports use
<attached: filename.ext>for media messages, which was not recognized by the parser. Media lines were rendered as plain text instead of being linked and playable. The localized keyword varies by language (e.g.,<Anhang:in German,<adjunto:in Spanish,<allegato:in Italian).Languages covered
English, German (2 variants), Spanish, Catalan, Italian, Portuguese (PT + BR), French, Dutch, Swedish, Norwegian, Danish, Finnish, Irish, Czech, Slovak, Polish, Hungarian, Romanian, Croatian/Slovenian, Turkish, Vietnamese, Indonesian, Malay, Russian, Ukrainian, Greek, Arabic, Persian, Urdu, Hebrew, Hindi, Marathi, Gujarati, Thai, Chinese (+ fullwidth colon), Japanese (+ fullwidth colon), Korean
Validation
npm run check— 0 errorsnpm run lint— 0 issuesnpm run build— exit 0