# ghostkit/3.3.2/gutenberg/blocks/testimonial/transforms.js

Block Animations, Motion &amp; Scroll Effects – Ghost Kit, version 3.3.2. 38 lines.

- Page: https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/blocks/testimonial/transforms.js
- Raw: https://pluginprobe.com/plugins/ghostkit/3.3.2/raw/gutenberg/blocks/testimonial/transforms.js
- Modified: 2024-02-18T18:40:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ghostkit/3.3.2/code/gutenberg/blocks/testimonial/transforms.js#L10-L20`.

```javascript
import { createBlock } from '@wordpress/blocks';
import {
	__UNSTABLE_LINE_SEPARATOR,
	create,
	split,
	toHTMLString,
} from '@wordpress/rich-text';

export default {
	from: [
		{
			type: 'block',
			blocks: ['core/quote', 'core/pullquote'],
			transform(attrs) {
				const paragraphs = split(
					create({
						html: attrs.value,
						multilineTag: 'p',
					}),
					__UNSTABLE_LINE_SEPARATOR
				);

				return createBlock(
					'ghostkit/testimonial',
					{
						source: attrs.citation || '',
					},
					paragraphs.map((piece) =>
						createBlock('core/paragraph', {
							content: toHTMLString({ value: piece }),
						})
					)
				);
			},
		},
	],
};

```
