- Forums
- react
- Pre Format Style For Comments whiteSpace pre-wrap inherit Sharepoint
This is a snippet to use for pre comments and text sometimes used in sharepoint [5316], Last Updated: Mon Jun 24, 2024
edw
Sat Apr 27, 2024
0 Comments
173 Visits
This is a simple snippet to use when you want to show pre comments to avoid HTML line breaks or white spaces
In HTML
style="white-space: 'pre-wrap'; font-family: inherit; font-size: inherit"
In React:
style={{ whiteSpace: 'pre-wrap', 'fontFamily': "inherit", 'fontSize': "inherit" }}
Example React:
<pre className="alert alert-light" style={{ whiteSpace: 'pre-wrap', 'fontFamily': "inherit", 'fontSize': "inherit" }}>{item.cardDetailedText}</pre>