node-pptx-templater 2.0.0-alpha.1 → 2.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/OutputWriter.js +15 -2
- package/src/core/PPTXTemplater.js +21 -5
- package/src/core/ValidationEngine.js +40 -0
- package/src/managers/ContentTypesManager.js +13 -0
- package/src/managers/MediaManager.js +38 -0
- package/src/managers/RelationshipManager.js +21 -0
- package/src/managers/SlideManager.js +951 -60
- package/src/utils/relationshipUtils.js +3 -3
|
@@ -69,10 +69,10 @@ function isValidRelationshipId(str) {
|
|
|
69
69
|
function remapRelationshipIds(xml, idMap) {
|
|
70
70
|
if (!idMap || idMap.size === 0) return xml
|
|
71
71
|
|
|
72
|
-
//
|
|
73
|
-
return xml.replace(
|
|
72
|
+
// Match any relationship ID attribute reference prefixed with r: (e.g. r:id, r:embed, r:link, r:dm, r:lo, r:qs, r:cs)
|
|
73
|
+
return xml.replace(/\b(r:[a-zA-Z0-9_]+)=(["'])(rId\d+)\2/g, (match, attr, quote, id) => {
|
|
74
74
|
if (idMap.has(id)) {
|
|
75
|
-
return `${
|
|
75
|
+
return `${attr}=${quote}${idMap.get(id)}${quote}`
|
|
76
76
|
}
|
|
77
77
|
return match
|
|
78
78
|
})
|