@@ -250,39 +250,39 @@ function removeBullet(str: string) {
250250 return unbulleted ;
251251}
252252
253- export const commands : Record < string , ( ta : HTMLInputElement ) => void > = {
254- 'editor:toggle-bold' : ( input : HTMLInputElement ) => {
253+ export const commands : Record < string , ( ta : HTMLTextAreaElement ) => void > = {
254+ 'editor:toggle-bold' : ( input : HTMLTextAreaElement ) => {
255255 toggleWrappingFormattingCommand ( input , isBoldedRegEx , unBold , '**' ) ;
256256 } ,
257- 'editor:toggle-code' : ( input : HTMLInputElement ) => {
257+ 'editor:toggle-code' : ( input : HTMLTextAreaElement ) => {
258258 toggleWrappingFormattingCommand ( input , isCodeRegEx , unCode , '`' ) ;
259259 } ,
260- 'editor:toggle-italics' : ( input : HTMLInputElement ) => {
260+ 'editor:toggle-italics' : ( input : HTMLTextAreaElement ) => {
261261 toggleWrappingFormattingCommand (
262262 input ,
263263 isItalicizedRegEx ,
264264 unItalicize ,
265265 '*'
266266 ) ;
267267 } ,
268- 'editor:toggle-highlight' : ( input : HTMLInputElement ) => {
268+ 'editor:toggle-highlight' : ( input : HTMLTextAreaElement ) => {
269269 toggleWrappingFormattingCommand (
270270 input ,
271271 isHighlightedRegEx ,
272272 unHighlight ,
273273 '=='
274274 ) ;
275275 } ,
276- 'editor:toggle-strikethrough' : ( input : HTMLInputElement ) => {
276+ 'editor:toggle-strikethrough' : ( input : HTMLTextAreaElement ) => {
277277 toggleWrappingFormattingCommand ( input , isStrikedRegEx , unStrike , '~~' ) ;
278278 } ,
279- 'editor:toggle-blockquote' : ( input : HTMLInputElement ) => {
279+ 'editor:toggle-blockquote' : ( input : HTMLTextAreaElement ) => {
280280 toggleLineFormatting ( input , isQuoted , applyQuote , removeQuote ) ;
281281 } ,
282- 'editor:toggle-bullet-list' : ( input : HTMLInputElement ) => {
282+ 'editor:toggle-bullet-list' : ( input : HTMLTextAreaElement ) => {
283283 toggleLineFormatting ( input , isBulleted , applyBullet , removeBullet ) ;
284284 } ,
285- 'editor:toggle-numbered-list' : ( input : HTMLInputElement ) => {
285+ 'editor:toggle-numbered-list' : ( input : HTMLTextAreaElement ) => {
286286 toggleLineFormatting (
287287 input ,
288288 isOrderedList ,
@@ -291,7 +291,7 @@ export const commands: Record<string, (ta: HTMLInputElement) => void> = {
291291 ) ;
292292 } ,
293293
294- 'editor:toggle-checklist-status' : ( input : HTMLInputElement ) => {
294+ 'editor:toggle-checklist-status' : ( input : HTMLTextAreaElement ) => {
295295 const state = getStateFromInput ( input ) ;
296296 const isEmptySelection = state . selection . end === state . selection . start ;
297297
@@ -347,7 +347,7 @@ export const commands: Record<string, (ta: HTMLInputElement) => void> = {
347347
348348export const autoPairBracketsCommands : Record <
349349 string ,
350- ( ta : HTMLInputElement ) => boolean
350+ ( ta : HTMLTextAreaElement ) => boolean
351351> = {
352352 '(' : ( input ) => applyWrappingFormatting ( input , '(' , ')' , false ) ,
353353 '[' : ( input ) => applyWrappingFormatting ( input , '[' , ']' , false , true ) ,
@@ -358,7 +358,7 @@ export const autoPairBracketsCommands: Record<
358358
359359export const autoPairMarkdownCommands : Record <
360360 string ,
361- ( ta : HTMLInputElement ) => boolean
361+ ( ta : HTMLTextAreaElement ) => boolean
362362> = {
363363 '*' : ( input ) => applyWrappingFormatting ( input , '*' , '*' , false ) ,
364364 _ : ( input ) => applyWrappingFormatting ( input , '_' , '_' , false ) ,
@@ -385,8 +385,8 @@ const pairMap: Record<string, string> = {
385385} ;
386386
387387export function unpair (
388- input : HTMLInputElement ,
389- commandList : Record < string , ( ta : HTMLInputElement ) => boolean >
388+ input : HTMLTextAreaElement ,
389+ commandList : Record < string , ( ta : HTMLTextAreaElement ) => boolean >
390390) {
391391 const state = getStateFromInput ( input ) ;
392392
@@ -412,11 +412,11 @@ export function unpair(
412412 }
413413}
414414
415- export function unpairBrackets ( input : HTMLInputElement ) {
415+ export function unpairBrackets ( input : HTMLTextAreaElement ) {
416416 return unpair ( input , autoPairBracketsCommands ) ;
417417}
418418
419- export function unpairMarkdown ( input : HTMLInputElement ) {
419+ export function unpairMarkdown ( input : HTMLTextAreaElement ) {
420420 return unpair ( input , autoPairMarkdownCommands ) ;
421421}
422422
@@ -448,7 +448,7 @@ function removeTab(str: string, useTab: boolean, tabWidth: number) {
448448}
449449
450450export function handleTab (
451- input : HTMLInputElement ,
451+ input : HTMLTextAreaElement ,
452452 isShiftPressed : boolean ,
453453 useTab : boolean ,
454454 tabWidth : number
@@ -492,7 +492,7 @@ export function handleTab(
492492 return true ;
493493}
494494
495- export function handleNewLine ( input : HTMLInputElement ) {
495+ export function handleNewLine ( input : HTMLTextAreaElement ) {
496496 const initialState = getStateFromInput ( input ) ;
497497
498498 if ( initialState . selection . start !== initialState . selection . end ) {
0 commit comments