8 lines
218 B
JavaScript
8 lines
218 B
JavaScript
|
const contentWithHeading = ( content, heading, headingLevel = 'h3' ) => {
|
||
|
return content && content.length
|
||
|
? [ { [ headingLevel ]: heading }, { html: content } ]
|
||
|
: [];
|
||
|
};
|
||
|
|
||
|
module.exports = { contentWithHeading };
|