https://svenskjakt.se/wp-content/plugins/svenskjakt-gutenberg/bloc…/header-mellanrubrik.js?ver=1.0.3
1wp.blocks.registerBlockType( 'svensk-jakt/header-mellanrubrik', { 2 title: 'Rubrik: Mellanrubrik', 3 description: 'Visar en mellanrubrik', 4 category: 'svensk-jakt', 5 icon: 'heading', 6 keywords: ['svensk jakt', 'rubrik', 'mellanrubrik', 'mellan'], 7 /* 8 acf: { 9 mode: 'preview', 10 renderTemplate: 'header-mellanrubrik-template.php', 11 postTypes: ['post'] 12 }, 13 */ 14 attributes: { 15 content: { 16 source: 'html', 17 selector: 'h2', 18 } 19 }, 20 21 transforms: { 22 from: [ 23 { 24 type: 'block', 25 blocks: ['core/paragraph', 'core/code', 'core/preformatted', 'core/heading', 'svensk-jakt/header-underrubrik', 'svensk-jakt/header-question'], 26 transform: function (attributes) { 27 return wp.blocks.createBlock('svensk-jakt/header-mellanrubrik', { 28 content: attributes.content 29 }); 30 } 31 } 32 ], 33 to: [ 34 { 35 type: 'block', 36 blocks: ['core/paragraph'], 37 transform: function (attributes) { 38 return wp.blocks.createBlock('core/paragraph', { 39 content: attributes.content 40 }); 41 } 42 }, 43 { 44 type: 'block', 45 blocks: ['svensk-jakt/header-underrubrik'], 46 transform: function (attributes) { 47 return wp.blocks.createBlock('svensk-jakt/header-underrubrik', { 48 content: attributes.content 49 }); 50 } 51 }, 52 { 53 type: 'block', 54 blocks: ['svensk-jakt/header-question'], 55 transform: function (attributes) { 56 return wp.blocks.createBlock('svensk-jakt/header-question', { 57 content: attributes.content 58 }); 59 } 60 } 61 ] 62 }, 63 64 edit: function( props ) { 65 return wp.element.createElement( 66 wp.blockEditor.RichText, { 67 className: props.className, 68 value: props.attributes.content, 69 tagName: 'h2', 70 disableLineBreaks: true, 71 allowedFormats: [], 72 onChange: function( newContent ) { 73 props.setAttributes( { content: newContent } ); 74 } 75 } 76 ); 77 }, 78 79 save: function( props ) { 80 return wp.element.createElement( wp.blockEditor.RichText.Content, { 81 tagName: 'h2', 82 value: props.attributes.content, 83 } ); 84 } 85} );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.