Extra line breaks are added to the rich text fields of Knowledge object when importing CSV by Dataloader v60 or higher.
In Dataloader v59, LF is converted to blank space. This behavior change leads to add the extra line breaks to the rich text fields because of the following reasons:
1) New Lightning Article Editor add spaces between <p> tag when adding line breaks in rich text field.
UI:
Data:
----
<p>test1</p> <p>test2</p> <p>test3</p>
----
2) When exporting this data by Dataloader (version is not related), spaces (20) are converted to LF (0A).
"<p>test1</p>
<p>test2</p>
<p>test3</p>"
3) And when importing this data by Dataloader v60 or higher, LF is converted to <BR> tag which leads to extra line breaks.
UI:
Data:
----
<p>test1</p><br><p>test2</p><br><p>test3</p>
----
Dataloader contains a config property sfdc.load.preserveWhitespaceInRichText that causes the line breaks to be converted into BR tags.
"sfdc.load.preserveWhitespaceInRichText" is a read-only property that's set to true by default. So, if you set it to false in config.properties file (making sure that data loader is not running when you modify config.properties file), you will get intended behavior.
You upload two kinds of texts in RTF field:
004633920

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.