Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add key action to table in markdown #1126

Merged
merged 6 commits into from
Aug 20, 2020
Merged

Conversation

seonim-ryu
Copy link
Member

@seonim-ryu seonim-ryu commented Jul 27, 2020

Please check if the PR fulfills these requirements

  • It's the right issue type on the title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has a description of the breaking change

Description

Use case 1: tab key

Pressing the tab key in the markdown table moves the cursor cell by cell.

Before

  • tab : The text is indented in the cell.
  • shift + tab : The text is outdented in the cell.

tab-current

After

  • tab :
    • If it is not the last cell in a row, pressing tab moves to the next cell.
    • For the last cell in a row, pressing tab moves to the first cell in the next row.
    • If you press tab in the last cell of the table, he cursor is positioned outside the table (ending point).
  • shift + tab :
    • If it is not the first cell in a row, pressing shift + tab moves to the previous cell.
    • For the first cell in a row, pressing shift + tab moves to the last cell in the previous row.
    • If you press shift + tab in the first cell of the table, the cursor is positioned outside the table (starting point).

tab

Use case 2 : enter key

Pressing the enter key in the markdown table adds the syntax for the new row.

Before

  • Cell of table head : Table syntax is broken.
  • Cells in delimiter row : Table syntax is broken.
  • Cell of table body : A newline is added to the text in the cell and rendered with the remaining columns filled.

enter-current

After

  • Cell of table head : Table syntax is broken.
  • Cells in delimiter row : A new row with as many columns as the current number of columns is added.
  • Cell of table body :
    • A new row with as many columns as the current number of columns is added.
    • When adding a new row in the last row, if the current row is empty, remove the current row.

enter


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

@seonim-ryu seonim-ryu requested review from js87zz, lja1018 and shiren July 28, 2020 01:23
Copy link
Contributor

@lja1018 lja1018 left a comment

Choose a reason for hiding this comment

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

[07/28] 리뷰완료.
고생하셨습니다!

apps/editor/src/js/markdownEditor.js Outdated Show resolved Hide resolved

this.cm.setCursor({ line: line - 1, ch: ch - 1 });
}

Copy link
Contributor

Choose a reason for hiding this comment

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

키맵핑 부분은 command로 별도 분리하는게 더 깔끔하지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

커맨드로 분리해서 적용한 커밋입니다ㅎㅎ

c15692c

@seonim-ryu seonim-ryu force-pushed the feat/table-key-action branch from e54b659 to c15692c Compare July 29, 2020 11:16
@seonim-ryu seonim-ryu added this to the 2.4.0 milestone Aug 20, 2020
@seonim-ryu seonim-ryu merged commit 4df75a0 into master Aug 20, 2020
@seonim-ryu seonim-ryu deleted the feat/table-key-action branch September 3, 2020 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants