import Renderables from '../Renderables';
import node from "../../support/node";
import { Specification } from "../../support/Specification";
/**
 * Implementation of the 'headline' markup element.
 * With no level set, a h2 HTML element is created and the class
 * lto-headline is added to allow CSS manipulations.
 *
 * @see {@link IRenderable}
 */
var Headline = /** @class */ (function () {
    function Headline(spec) {
        this.spec = spec;
    }
    /**
     * @inheritDoc
     */
    Headline.prototype.render = function (renderer, isNested) {
        var tag = "h2";
        if (this.spec.level) {
            tag = "h" + this.spec.level;
        }
        var headline = node(tag);
        new Specification(this.spec).initNode(headline, "lto-headline");
        return headline.unwrap();
    };
    return Headline;
}());
export { Headline };
Renderables.register("headline", Headline);
//# sourceMappingURL=index.js.map