import { formatDocAsSingleLine } from '../../base-application/support/index.mjs';
const htmlEncode = text => {
    let htmLifiedText = text;
    htmLifiedText = htmLifiedText.replace(/&/g, '&amp;');
    htmLifiedText = htmLifiedText.replace(/"/g, '&quot;');
    htmLifiedText = htmLifiedText.replace(/'/g, '&apos;');
    htmLifiedText = htmLifiedText.replace(/</g, '&lt;');
    htmLifiedText = htmLifiedText.replace(/>/g, '&gt;');
    return htmLifiedText;
};
const formatAsLiquibaseRemarks = (text, addRemarksTag = false) => {
    if (!text) {
        return addRemarksTag ? '' : text;
    }
    const description = htmlEncode(formatDocAsSingleLine(text));
    return addRemarksTag ? ` remarks="${description}"` : description;
};
export default formatAsLiquibaseRemarks;
