Hello,
What license and version of phpdocx are you using?
The modifyInputFields method doesn't allow adding line breaks to the contents, but using the latest release of Advanced and Premium licenses of phpdocx and DOCXPath you can replace and add contents in rich text fields (not all input fields accept line breaks) such as new contents with line breaks.
Regards.