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

fix: table head is missing when pasting the table from ms word #1857

Merged
merged 3 commits into from
Oct 19, 2021

Conversation

js87zz
Copy link
Contributor

@js87zz js87zz commented Oct 6, 2021

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

as-is

2021-10-06 10-38-34 2021-10-06 10_38_55

to-be

2021-10-06 10-36-08 2021-10-06 10_36_25


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

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.

리뷰완료합니다.

Comment on lines 160 to 164
if (startFromBody) {
return schema.nodes.table.create(null, [createTableBody(rows, columnCount, schema)]);
if (isInTable) {
return schema.nodes.table.create(null, [createTableBody(rows, columnCount, schema)]);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

if (startFromBody && isInTable)은 어떤가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아 막판에 코드 변경하면서 이렇게 되었군요. 넵 변경하겠습니다~!

Comment on lines 105 to 107
const dummyCell = tableHeadCell.createAndFill()!;

cells.push(dummyCell);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const dummyCell = tableHeadCell.createAndFill()!;
cells.push(dummyCell);
cells.push(tableHeadCell.createAndFill());

바로 사용해도 되지 않나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

그렇긴한데..요건 가독성 때문에 변수를 선언한 다음에 사용하였습니다~!

Copy link

@dongsik-yoo dongsik-yoo left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다. 수고하셨습니다.

@@ -97,6 +97,19 @@ function creatTableBodyDummyRow(columnCount: number, schema: Schema) {
return tableRow.create({ dummyRowForPasting: true }, cells);
}

function creatTableHeadDummyRow(columnCount: number, schema: Schema) {

Choose a reason for hiding this comment

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

이 함수 쓰는데가 PR에서는 안 보이는데요. 사용처가 있는거죠?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제거 예정입니다!


if (items) {
if (items?.length === 1) {

Choose a reason for hiding this comment

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

조건문이 달라졌는데 이 이슈와 관련이 있는거죠?

Copy link
Contributor Author

@js87zz js87zz Oct 6, 2021

Choose a reason for hiding this comment

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

넵 워드에서 복사한 클립보드 데이터 종류가 여러 가지 타입으로 존재하는데 그 중에 이미지 데이터도 있어서 조건을 추가하였습니다! 해당 조건을 추가하지 않으면 테이블이 무조건 이미지 형태로만 복사가 되어서 문제가 됩니다.

Choose a reason for hiding this comment

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

넵 확인하였습니다.

@js87zz js87zz merged commit 8d434ce into master Oct 19, 2021
@js87zz js87zz deleted the fix/paste-table-ms-word branch October 19, 2021 10:49
ahamelers pushed a commit to ahamelers/tui.editor that referenced this pull request Aug 21, 2023
)

* fix: cannot paste table head from ms word

* fix: start table head when pasting ms word table

* chore: apply code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants