-
-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(markdown): incorrect list indentation alignment in markdown parser #4884
fix(markdown): incorrect list indentation alignment in markdown parser #4884
Conversation
This breaks |
尝试重构了下 |
Converted the PR to Draft. |
(Sorry for using chinese. It is hard to descript my question by my poor English) coc.nvim/src/markdown/renderer.ts Lines 96 to 99 in 574c12c
@fannheyward issue 提到的这个问题的核心原因在于上面的函数对某些行多次调用,导致重复插入了多余的空格。而 - foo
- hello
- me
you
them 遍历结果: 简单来说就是在遍历的过程中,那些没有 而正确的处理应该是对于没有 那么这个问题的关键就在于如何区分哪些行是已经添加过空格的,这里我有两个方案
还有一种就是把处理过的行存起来,然后遍历的时候,再通过对比进行判断,但是这个方案需要考虑的东西太多,例如如何正确判断当前行是已经处理过的行,如果正好有一样的文本怎么办,所以我个人认为这种也不可取 第一个方案是理论最可行的,但是他的实现并不优雅 这个问题不是什么大问题,不影响功能,只是个展示样式的错位,不过要处理起来也感觉也并不简单。有空研究下提供下意见 |
这个不对吧,比如
|
@fannheyward 他这个函数是用来处理对齐 假设
所以这个地方不是处理整个层级缩进的,只处理层级自身的缩进对齐 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4884 +/- ##
==========================================
+ Coverage 98.55% 98.58% +0.02%
==========================================
Files 273 273
Lines 26077 26088 +11
Branches 5392 5393 +1
==========================================
+ Hits 25701 25718 +17
+ Misses 222 216 -6
Partials 154 154 ☔ View full report in Codecov by Sentry. |
按照第一个方案改了一个版本,缺点是需要在每一个 marked.setOptions({
renderer: new Renderer(),
hooks: Renderer.hooks,
}) |
#4947 更新到了 marked 7,辛苦 rebase 测试一下 |
353b0d5
to
2a714a9
Compare
2a714a9
to
83c6d2f
Compare
@fannheyward Done. |
9190bfe feat(list): add --buffer to list buffer diags (#4958) fb030d4 fix(defaultAction) fallback to default action on emtpy expression (#4954) 846994b fix(inlayHint): more compact padding highlight group (#4950) b01ae44 feat(semanticTokens)!: token highlight groups (#4667) 8c85d6f fix(markdown): incorrect list indentation alignment in markdown parser (#4884) 0d66554 fix(inlayHint): hl_mode = 'replace' for neovim (#4949) 1a8244e chore(package): update dependencies (#4948) 4f68722 feat(client): upgrade to marked 7 (#4947) 574c12c feat(package): @types/node@18 (#4946) d299c66 feat(menu): C-j/k to navigate menu (#4945) 34d3d9d chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#4944) aead8f4 chore(CI): use Node 20 (#4940)
fix #4882