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;