From 8790ccbbd405e5aa98b0e0a1b6a459021ac2fefc Mon Sep 17 00:00:00 2001 From: Aikakakah <145503852+Aikakakah@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:07:13 -0500 Subject: [PATCH] italics --- js/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/index.js b/js/index.js index cbb678e..387ed8e 100644 --- a/js/index.js +++ b/js/index.js @@ -17,6 +17,13 @@ document.addEventListener('DOMContentLoaded', () => { }); }); + document.addEventListener('keydown', (event) => { + if (event.ctrlKey && event.key.toLowerCase() === 'i') { + event.preventDefault(); // Prevent default browser behavior + insertTag('italic'); + } + }); + window.changeHeaderLevel = function() { const selectElement = document.getElementById('header-select-select'); const selectedValue = selectElement.value;