// #region Imports
import { RichTextCommand } from './Abstracts/RichTextCommand';
// #endregion
/**
 * ItalicCommand class to handle italic formatting in a textarea.
 *
 * @public
 */
export class ItalicCommand extends RichTextCommand {
    // #region Ctor
    /**
     * Constructs a new instance of the `BoldCommand` class.
     *
     * @public
     */
    constructor() {
        super();
    }
    // #endregion
    // #region Methods
    /**
     * Toggles italic formatting on the selected text within the contenteditable div.
     *
     * @public
     * @returns {boolean} - True if the operation was successful, otherwise false.
     */
    execute() {
        if (!this.contentEditable) {
            console.error('ItalicCommand is not attached to any contenteditable element.');
            return false;
        }
        return this.toggleFormatting('em', '_');
    }
}
//# sourceMappingURL=ItalicCommand.js.map