@@ -201,7 +201,7 @@ export type TextMatchTransformer = Readonly<{
201201
202202const ORDERED_LIST_REGEX = / ^ ( \s * ) ( \d { 1 , } ) \. \s / ;
203203const UNORDERED_LIST_REGEX = / ^ ( \s * ) [ - * + ] \s / ;
204- const CHECK_LIST_REGEX = / ^ ( \s * ) (?: - \s ) ? \s ? ( \[ ( \s | x ) ? \] ) \s / i;
204+ const CHECK_LIST_REGEX = / ^ ( \s * ) (?: [ - * + ] \s ) ? \s ? ( \[ ( \s | x ) ? \] ) \s / i;
205205const HEADING_REGEX = / ^ ( # { 1 , 6 } ) \s / ;
206206const QUOTE_REGEX = / ^ > \s / ;
207207const CODE_START_REGEX = / ^ [ \t ] * ` ` ` ( [ \w - ] + ) ? / ;
@@ -252,8 +252,8 @@ const listReplace = (listType: ListType): ElementTransformer['replace'] => {
252252 const listItem = $createListItemNode (
253253 listType === 'check' ? match [ 3 ] === 'x' : undefined ,
254254 ) ;
255- if ( listType === 'bullet' ) {
256- const markerFound = match [ 0 ] . trim ( ) ;
255+ if ( listType === 'bullet' || listType === 'check' ) {
256+ const markerFound = match [ 0 ] [ 0 ] ;
257257 const listMarker : ListMarker = $isListMarker ( markerFound )
258258 ? markerFound
259259 : '-' ;
@@ -316,7 +316,7 @@ const listExport = (
316316 listType === 'number'
317317 ? `${ listNode . getStart ( ) + index } . `
318318 : listType === 'check'
319- ? `- [${ listItemNode . getChecked ( ) ? 'x' : ' ' } ] `
319+ ? `${ listItemNode . getMarker ( ) } [${ listItemNode . getChecked ( ) ? 'x' : ' ' } ] `
320320 : listItemNode . getMarker ( ) + ' ' ;
321321 output . push ( indent + prefix + exportChildren ( listItemNode ) ) ;
322322 index ++ ;
0 commit comments