# ghostkit/3.4.1/gutenberg/blocks/gist/transforms.js

Block Animations, Motion &amp; Scroll Effects – Ghost Kit, version 3.4.1. 28 lines.

- Page: https://pluginprobe.com/plugins/ghostkit/3.4.1/code/gutenberg/blocks/gist/transforms.js
- Raw: https://pluginprobe.com/plugins/ghostkit/3.4.1/raw/gutenberg/blocks/gist/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.4.1/code/gutenberg/blocks/gist/transforms.js#L10-L20`.

```javascript
import { createBlock } from '@wordpress/blocks';

export default {
	from: [
		{
			type: 'raw',
			priority: 1,
			isMatch: (node) => {
				const match =
					node.nodeName === 'P' &&
					/^https:\/\/gist.github.com?.+\/(.+)/g.exec(
						node.textContent
					);

				if (match && typeof match[1] !== 'undefined') {
					return true;
				}

				return false;
			},
			transform: (node) =>
				createBlock('ghostkit/gist', {
					url: node.textContent.trim(),
				}),
		},
	],
};

```
