Comments (4)
The white-space characters get collapsed by default. Try adding something like white-space: pre;
to your css. It can be either on the element itself or higher up.
More info here:
https://developer.mozilla.org/en-US/docs/Web/CSS/white-space
from redraft.
Wohh, never thought of that. Thank you. Though I should have the look into the rendered HTML and see that the spaces are there. Thank you.
from redraft.
You're welcome
from redraft.
For those that might check this issue in the future. Add white-space: pre-wrap
to a parent div, this way it will preserve spaces and wrap to new lines (as editor js does)
from redraft.
Related Issues (20)
- fixed render entities
- [Question] How do I retain inline styles of HTML tags?
- Flat rendering of inline style ranges with complex inline styles HOT 7
- Ignore `.babelrc` in `.npmignore`
- Issue with style renderer and collision in style key HOT 3
- Support complex decorators HOT 8
- Add support for draft-js-plugins HOT 7
- PrismDecorator doesn't work HOT 7
- Decorators incorrectly handle emojis HOT 2
- ReactNative support HOT 7
- Node styles being treated as equal when having the same amount
- Content Style Not Being Applied Correctly HOT 9
- Commas added to each tag when outputting to string HOT 2
- rendering empty line as `<br />` HOT 2
- Accept customStyleFn similar to draft-js HOT 1
- Just question
- entities block key
- How to get the HTML output after ```convertToRaw()```
- Redraft keeps duplicating entities when entity is copy-pasted from editor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redraft.