Skip to content

Commit

Permalink
v2.7.9
Browse files Browse the repository at this point in the history
- Updated the "Relink compendium Entries" macro:
  - Fixed issue where links that included anchors would be skipped. Thanks JonnyGabble on Discord for the report.
  • Loading branch information
sneat authored Dec 15, 2023
1 parent d36d642 commit f4e3793
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v2.7.9

- Updated the "Relink compendium Entries" macro:
- Fixed issue where links that included anchors would be skipped. Thanks JonnyGabble on Discord for the report.

## v2.7.8

- Adjustments to handle new data structures expected by [Monk's Active Tile Triggers](https://foundryvtt.com/packages/monks-active-tiles).
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "scene-packer",
"title": "Library: Scene Packer",
"description": "A module to assist with Scene and Adventure packing and unpacking.",
"version": "2.7.8",
"version": "2.7.9",
"library": "true",
"manifestPlusVersion": "1.2.0",
"minimumCoreVersion": "0.8.6",
Expand Down
7 changes: 4 additions & 3 deletions scripts/scene-packer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@ export default class ScenePacker {
newRef: newRef,
pack: pack.collection,
journalEntryId: entry._id,
journalAnchorLink: anchor ? anchor : '',
journalAnchorLink: anchor ? `#${anchor}` : '',
});
}

Expand Down Expand Up @@ -5107,7 +5107,7 @@ export default class ScenePacker {
const prefix = CONSTANTS.IsV10orNewer() ? '@UUID[' : '@Compendium[';
const newReference = change.newRef[0];
if (!newReference.uuid) {
newReference.uuid = `${newReference.pack}.${newReference.ref}${change.journalAnchorLink}`;
newReference.uuid = `${newReference.pack}.${newReference.ref}`;
}
if (!CONSTANTS.IsV10orNewer() && newReference.uuid.startsWith('Compendium.')) {
newReference.uuid = newReference.uuid.replace('Compendium.', '');
Expand All @@ -5132,9 +5132,10 @@ export default class ScenePacker {
`@${change.type}\\[${change.oldRef}${change.journalAnchorLink}\\]\\{`,
'g',
);
const replacement = change.journalAnchorLink ? `${prefix}${newReference.uuid}${change.journalAnchorLink}]{` : `${prefix}${newReference.uuid}]{`;
newContent = newContent.replace(
regex,
`${prefix}${newReference.uuid}]{`,
replacement,
);
}

Expand Down

0 comments on commit f4e3793

Please sign in to comment.