//#region src/sync/converters/html.ts
/**
* Convert an HTML fragment to Markdown using Turndown with the GitHub-flavored
* plugin (tables, strikethrough, task lists). Turndown and the plugin are
* loaded lazily so they stay out of the light default code path.
*/
async function htmlToMarkdown(html) {
	const TurndownService = (await import("turndown")).default;
	const { gfm } = await import("@joplin/turndown-plugin-gfm");
	const service = new TurndownService({
		headingStyle: "atx",
		codeBlockStyle: "fenced",
		bulletListMarker: "-"
	});
	service.use(gfm);
	return service.turndown(html).trim();
}
const htmlConverter = {
	name: "html",
	extensions: [
		"html",
		"htm",
		"xhtml"
	],
	mimeTypes: ["text/html", "application/xhtml+xml"],
	async convert(buffer) {
		return {
			markdown: await htmlToMarkdown(buffer.toString("utf-8")),
			meta: { format: "html" }
		};
	}
};
//#endregion
Object.defineProperty(exports, "htmlConverter", {
	enumerable: true,
	get: function() {
		return htmlConverter;
	}
});
Object.defineProperty(exports, "htmlToMarkdown", {
	enumerable: true,
	get: function() {
		return htmlToMarkdown;
	}
});

//# sourceMappingURL=html-CmOku6jS.cjs.map