import { stringifyEntities } from "../../../stringify-entities/lib/index.js";
var htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g, bogusCommentEntitySubset = [">"], commentEntitySubset = ["<", ">"];
function comment(i, a, o, s) {
	return s.settings.bogusComments ? "<?" + stringifyEntities(i.value, Object.assign({}, s.settings.characterReferences, { subset: bogusCommentEntitySubset })) + ">" : "<!--" + i.value.replace(htmlCommentRegex, c) + "-->";
	function c(r) {
		return stringifyEntities(r, Object.assign({}, s.settings.characterReferences, { subset: commentEntitySubset }));
	}
}
export { comment };
