Fix (file names): Keep duplicate page postfixes and avoid broken attachment and image links - #193
Open
klangme1ster wants to merge 1 commit into
Conversation
klangme1ster
commented
Sep 24, 2026
- Duplicate page names: the '-1', '-2' postfix was appended before truncating to mdFileNameAndFolderNameMaxLength, so for long names it was cut off again, and the pages overwrote each other. Duplicates are now detected on the truncated name (which also catches long names that only differ after the cut-off), and the postfix survives truncation (new Truncate-PathFileName -KeepSuffix).
- Inserted attachments: references were replaced with a plain search, so with attachments '11-36002.pdf' and 'Datenblatt_11-36002.pdf' on one page, the first name also matched inside the second, nesting one link inside the other. Only whole file names are matched now.
- Images: image file names are prefixed with the page path, which can contain characters like '#' and "'" (e.g. 'c't-expert-community--Newsletter-Errors all over the place #10-image1.jpg'). A '#' in a link is read as a URL fragment, breaking the image. Image names now go through Remove-InvalidFileNameCharsInsertedFiles, like inserted attachments.
…chment and image links - Duplicate page names: the '-1', '-2' postfix was appended before truncating to mdFileNameAndFolderNameMaxLength, so for long names it was cut off again, and the pages overwrote each other. Duplicates are now detected on the truncated name (which also catches long names that only differ after the cut-off), and the postfix survives truncation (new Truncate-PathFileName -KeepSuffix). - Inserted attachments: references were replaced with a plain search, so with attachments '11-36-00002.pdf' and 'Datenblatt_11-36-00002.pdf' on one page, the first name also matched inside the second, nesting one link inside the other. Only whole file names are matched now. - Images: image file names are prefixed with the page path, which can contain characters like '#' and "'" (e.g. 'c't-expert-community--Newsletter-theohbrothers#10-image1.jpg'). A '#' in a link is read as a URL fragment, breaking the image. Image names now go through Remove-InvalidFileNameCharsInsertedFiles, like inserted attachments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.