Skip to content

Commit

Permalink
fix: yjs service 주석 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ezcolin2 committed Nov 30, 2024
1 parent a4f9000 commit 9629eb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/backend/src/yjs/yjs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,13 @@ export class YjsService
}

// editor에서 paragraph 내부 text 노드의 text 값의 빈 문자열을 제거한다.
// text 값이 빈 문자열이면 empty text nodes are not allowed 에러가 발생합니다.
transformText(doc: any) {
doc.content.forEach((paragraph) => {
if (paragraph.type === 'paragraph' && Array.isArray(paragraph.content)) {
paragraph.content.forEach((textNode) => {
if (textNode.type === 'text' && textNode.text === '') {
textNode.text = ' '; // 빈 문자열을 "a"로 대체
textNode.text = ' '; // 빈 문자열을 공백으로 대체
}
});
}
Expand Down

0 comments on commit 9629eb6

Please sign in to comment.