node-pptx-templater 2.0.0-alpha.0 → 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.
@@ -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
- // Perform single-pass replacement of relationship IDs inside quotes to prevent clobbering
73
- return xml.replace(/([\'"])(rId\d+)([\'"])/g, (match, openQuote, id, closeQuote) => {
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 `${openQuote}${idMap.get(id)}${closeQuote}`
75
+ return `${attr}=${quote}${idMap.get(id)}${quote}`
76
76
  }
77
77
  return match
78
78
  })