src/html-amend.js
function beforeElementClose(input, element, content) {
            // Sanity check
            verifyParameterIsDefined(input, 'input', beforeElementClose.name);
            verifyParameterIsDefined(element, 'element', beforeElementClose.name);

            return insertBefore(normalizeValue(input), normalizeRegExp(`<\/${normalizeValue(element)}[^\>]*>`), normalizeValue(content));
        }
function beforeElementClose(input, element, content) {
            // Sanity check
            verifyParameterIsDefined(input, 'input', beforeElementClose.name);
            verifyParameterIsDefined(element, 'element', beforeElementClose.name);

            return insertBefore(normalizeValue(input), normalizeRegExp(`<\/${normalizeValue(element)}[^\>]*>`), normalizeValue(content));
        }
function beforeElementClose ( input , element , content ) { // Sanity check verifyParameterIsDefined ( input , 'input' , beforeElementClose . name ) ; verifyParameterIsDefined ( element , 'element' , beforeElementClose . name ) ; return insertBefore ( normalizeValue ( input ) , normalizeRegExp ( ` \/ ${ normalizeValue ( element ) } \> ` ) , normalizeValue ( content ) ) ; }
Inserts content into the input string before the first occurrence of the element close tag.

@param {String|Function} input the input to replace
@param {String|Function} element the element to insert before close
@param {String|Function} content the content to replace within the input string
@return {String} a String which has the content added before the first occurrence of the element close tag within the input string
@throws {String} when input or element are not defined
Inserts content into the input string before the first occurrence of the element close tag .