Keep previous paragraph node's attributes when user clicks Enter

you can just use storeMarks.

first, store the paragraph’ mark and then split the paragraph, and at last use setStoredMarks with you stored marks before within one transaction, like:

   const storedMark = $from.nodeBefore.marks; // you may need to filter some marks like link, etc
   tr.split(pos, 1, pType);
   tr.setStoredMarks(storedMark);