contentEditable을 div에 적용해, submit을 누를 시 e.target.innerHTML을 그대로 서버에 넘겨주는 방식을 사용했습니다.
다른 경우에는 문제 없이 작동했으나, 서식 적용 및 붙여넣기에서 몇몇 태그들에 style 속성이 붙어버릴 때, 500 에러가 나더라고요. 제 생각에는 style="font-family: var(--default-font-family)" 등과 같이 css 변수를 쓰는데, 이걸 서버에서 읽지 못하는 게 아닌가 싶습니다. 사실 요 스타일들이 없어도 클라이언트에서 알아서 저희 사이트 폰트에 맞춰서 보여주기 때문에, 불필요하게 생성된 style 속성을 없애주기만 하면 해결됐습니다. 이 외에 더 버그는 찾지 못했는데, 혹시 찾으면 제보 부탁합니다!
그리고 ArticleDetail에서 GET 할 시에, 똑같이 innerHTML을 통해 제어하는 것이 좋다고 판단하여 useState 대신 useRef로 DOM 조작하는 방식 택했습니다.
작업 내용
e.target.innerHTML
을 그대로 서버에 넘겨주는 방식을 사용했습니다.style
속성이 붙어버릴 때, 500 에러가 나더라고요. 제 생각에는style="font-family: var(--default-font-family)"
등과 같이 css 변수를 쓰는데, 이걸 서버에서 읽지 못하는 게 아닌가 싶습니다. 사실 요 스타일들이 없어도 클라이언트에서 알아서 저희 사이트 폰트에 맞춰서 보여주기 때문에, 불필요하게 생성된style
속성을 없애주기만 하면 해결됐습니다. 이 외에 더 버그는 찾지 못했는데, 혹시 찾으면 제보 부탁합니다!ArticleDetail
에서 GET 할 시에, 똑같이 innerHTML을 통해 제어하는 것이 좋다고 판단하여 useState 대신 useRef로 DOM 조작하는 방식 택했습니다.