extarea.value;
        
                    switch (format) {
                        case 'bold':
                            textarea.setRangeText(`**${currentValue.slice(start, end)}**`, start, end);
                            textarea.focus();
                            textarea.selectionStart = end + 4;
                            break;
                        case 'italic':
                            textarea.setRangeText(`*${currentValue.slice(start, end)}*`, start, end);
                        