Skip to content

Commit

Permalink
fix: added issue, table, help to commands, task list more like in git…
Browse files Browse the repository at this point in the history
…hub (#582)

* fix: Task list - always add unfinished task in the new line

This is how Github handles it.
It makes sense, as you add new task, you probably want to finish them in the future (not add them as finished).

* fix: Added issue, table, help to commands
  • Loading branch information
RARgames committed Oct 16, 2023
1 parent 2ffaaa0 commit a82c76b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions core/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { title4 } from './title4';
import { title5 } from './title5';
import { title6 } from './title6';
import { table } from './table';
import { issue } from './issue';
import { help } from './help';

export interface CommandOrchestrator {
Expand Down Expand Up @@ -202,6 +203,9 @@ export {
unorderedListCommand,
orderedListCommand,
checkedListCommand,
table,
issue,
help,
codeEdit,
codeLive,
codePreview,
Expand Down
8 changes: 5 additions & 3 deletions core/src/components/TextArea/handleKeyDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ export default function handleKeyDown(
startStr = '\n* ';
}

if (currentLineStr.startsWith('- [ ]')) {
if (
currentLineStr.startsWith('- [ ]') ||
currentLineStr.startsWith('- [X]') ||
currentLineStr.startsWith('- [x]')
) {
startStr = '\n- [ ] ';
} else if (currentLineStr.startsWith('- [X]') || currentLineStr.startsWith('- [x]')) {
startStr = '\n- [X] ';
}

if (/^\d+.\s/.test(currentLineStr)) {
Expand Down

1 comment on commit a82c76b

@vercel
Copy link

@vercel vercel bot commented on a82c76b Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.