"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createHtmlText;

var _utils = require("../../../utils");

/**
 * Convert markdown text to HTML and find media links in the text to download
 * @param {string} text markdown text
 * @param {string} targetDir target directory to pass to
 * @function downloadMediaInHtml to save the file
 * @param {string} label to label the media file
 */
async function createHtmlText(text, targetDir, label) {
  let html = (0, _utils.markdownToHtml)(text);
  html = await (0, _utils.downloadMediaInHtml)(html, targetDir, label);
  return html;
}