The whitespace at the beginning of the paragraph disappears

hello,i am new with prosemirror 。Recently I used it to develop my editor , but i found that if i import exist doc into editor , the whitespace at the beginning of the paragraph disappears , whitch is based on the normal paragraph define:

paragraph: {
    content: "inline*",
    group: "block",
    defining: true,
    parseDOM: [{tag: "p"}],
    toDOM() { return ["p", 0] }
  },

so I decide to change the way to define it to retain the whitespace like this:

  paragraph: {
    attrs: {
      content: {default: ''}
    },
    content: "inline*",
    group: "block",
    defining: true,
    parseDOM: [{
      tag: 'p',
      getAttrs(dom) {
        let content = dom.innerHTML
        return {
          content:content
        }
      } 
    }],
    toDOM(node) {
      let pDom = document.createElement('p')
      pDom.innerHTML = node.attrs.content
      return pDom
    }
  },

but it will cause a crash with

like: a_pitem On this issue, I don’t know what to do now :persevere:. How can I keep the space at the beginning of the paragraph,I hope I can get your help. Thank you very much

Does passing the preserveWhitespace: true option to DOMParser.parse help here?

I set it to preserveWhitespace: 'full' , but it only takes effect for other spaces, not for the first space