neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.16k stars 954 forks source link

Incorrect indentation alignment in markdown parser #4882

Closed hexh250786313 closed 3 months ago

hexh250786313 commented 5 months ago

Describe the bug

I found that the markdown parser in coc causes incorrect hierarchical alignment in markdown lists.

I added the following debugging code to retrieve the source markdown text and the parsed text:

// coc.nvim/src/markdown/index.ts line:168
  ...
  let startLnum = 0
  console.log('---source', content)
  let parsed = marked(content)
  console.log('---parsed', parsed)
  let links = Renderer.getLinks()
  ...

Here are the comparisons of source, coc parsed, markdown-preview-enhanced and github parsed:

src

compare

You can see that the one parsed by coc results in incorrect indentation alignment, causing the entire section of the list item to have an extra two spaces of indentation to the right.

hexh250786313 commented 5 months ago

https://github.com/neoclide/coc.nvim/pull/4884 may help

fixed