sanity-io / block-content-to-react

Deprecated in favor of @portabletext/react
https://github.com/portabletext/react-portabletext
MIT License
161 stars 25 forks source link

How to render empty <p></p> as linebreak? #53

Closed ceruberu closed 3 years ago

ceruberu commented 3 years ago

I'm using empty lines for better readability

스크린샷 2021-09-22 오후 10 58 53 스크린샷 2021-09-22 오후 11 00 00

These empty lines are ignored.

스크린샷 2021-09-22 오후 11 01 33

I tried using \n / empty space / and  

I guess the serializer just renders them as strings

ceruberu commented 3 years ago

I guess this was just CSS issue with tailwind, closing

debatz commented 3 years ago

I guess this was just CSS issue with tailwind, closing

Mind sharing ho did you solve it? Same issue here.

fuhrthom commented 2 years ago

Please post your solution for this problem.

trevorfehrman commented 1 year ago

If it's the same issue I just had a Tailwind reset was zero-ing out the margin on all <p> tags. I just added this to my globals.css file (I'm using Next)

.rich-text-container p {
  margin-bottom: 1rem;
}