"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.HTMLFormatter = void 0;

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _standalone = _interopRequireDefault(require("prettier/standalone"));

var _parserHtml = _interopRequireDefault(require("prettier/parser-html"));

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

var HTMLFormatter = /*#__PURE__*/function () {
  function HTMLFormatter() {
    (0, _classCallCheck2["default"])(this, HTMLFormatter);
  }

  (0, _createClass2["default"])(HTMLFormatter, [{
    key: "getFormatted",
    value: function getFormatted(rawText) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : HTMLFormatter.defaultOptions;
      var t = rawText;

      try {
        t = _standalone["default"].format(rawText, options);
      } catch (error) {// 
      }

      return t;
    }
  }, {
    key: "getRaw",
    value: function getRaw(formattedText) {
      return (0, _utils.removeUnprintableChar)(formattedText);
    }
  }]);
  return HTMLFormatter;
}();

exports.HTMLFormatter = HTMLFormatter;
HTMLFormatter.defaultOptions = {
  parser: 'html',
  plugins: [_parserHtml["default"]]
};

var _default = new HTMLFormatter();

exports["default"] = _default;
//# sourceMappingURL=HTMLFormatter.js.map
