UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 1.35 kB
{ "version": 3, "sources": ["../../src/shortcode/transforms.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { removep, autop } from '@wordpress/autop';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\t// Per \"Shortcode names should be all lowercase and use all\n\t\t\t// letters, but numbers and underscores should work fine too.\n\t\t\t// Be wary of using hyphens (dashes), you'll be better off not\n\t\t\t// using them.\" in https://codex.wordpress.org/Shortcode_API\n\t\t\t// Require that the first character be a letter. This notably\n\t\t\t// prevents footnote markings ([1]) from being caught as\n\t\t\t// shortcodes.\n\t\t\ttag: '[a-z][a-z0-9_-]*',\n\t\t\tattributes: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( attrs, { content } ) => {\n\t\t\t\t\t\treturn removep( autop( content ) );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpriority: 20,\n\t\t},\n\t],\n};\n\nexport default transforms;\n"], "mappings": ";AAGA,SAAS,SAAS,aAAa;AAE/B,IAAM,aAAa;AAAA,EAClB,MAAM;AAAA,IACL;AAAA,MACC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQN,KAAK;AAAA,MACL,YAAY;AAAA,QACX,MAAM;AAAA,UACL,MAAM;AAAA,UACN,WAAW,CAAE,OAAO,EAAE,QAAQ,MAAO;AACpC,mBAAO,QAAS,MAAO,OAAQ,CAAE;AAAA,UAClC;AAAA,QACD;AAAA,MACD;AAAA,MACA,UAAU;AAAA,IACX;AAAA,EACD;AACD;AAEA,IAAO,qBAAQ;", "names": [] }