You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ Added URL transform support for lexical card property arrays and nested object paths
closesTryGhost/Product#2722
Cards can have complex objects in their data properties that need URLs transformed. This commit adds support for handling deeply nested arrays of objects and paths.
Example card dataset :
```
{
images: [{
src: '/image.png',
sizes: {
small: {src: '/image-small.png'},
large: {src: '/image-large.png'}
}
}]
}
```
and the corresponding transform map:
```
urlTransformMap() {
return {
images: [{
src: 'url',
sizes: {
'small.src': 'url',
'large.src': 'url'
}
}]
}
}
```
Copy file name to clipboardExpand all lines: packages/url-utils/test/unit/utils/lexical-absolute-to-relative.test.js
+222Lines changed: 222 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -389,6 +389,228 @@ describe('utils: lexicalAbsoluteToRelative()', function () {
389
389
result.root.children[0].caption.should.equal('Captions are HTML with only <a href="/image-caption-link">links transformed</a> - this is a plaintext url: http://my-ghost-blog.com/plaintext-url');
390
390
});
391
391
392
+
it('handles cards with array properties',function(){
0 commit comments