obsidian-linter
obsidian-linter copied to clipboard
FR: Remove Blank Lines in File
Describe the Bug
line-break-at-document-end似乎没有正常工作,勾选Line Break at Document End,运行插件,正文间的间隔没有任何变化
@zuojinxin , it looks like you are using the wrong rule for what you are trying to do. Line break at the end of the file only affects the end of the file. It looks like you want to use consecutive-blank-lines.
Chinese translation via Google Translate: @zuojinxin ,看起来你对你想做的事情使用了错误的规则。 文件末尾的换行符只影响文件末尾。 看起来您想使用 consecutive-blank-lines。
no,“consecutive-blank-lines” ,I've used it,I hope there are no spaces in the text,This habit more accord with my notes
Describe the Bug
line-break-at-document-end似乎没有正常工作,勾选Line Break at Document End,运行插件,正文间的间隔没有任何变化
The parts of the document highlighted here are not affected by Line Break at Document End
as they are affected by Consecutive Blank Lines
. So I don't believe I understand what the problem is here. Could you give an example of markdown for what you have, what happens, and what you expect for Line Break at Document End
?
Chinese Translation via Google Translate: 此处突出显示的文档部分不受“文档末尾换行符”的影响,因为它们受“连续空白行”的影响。 所以我不相信我明白这里的问题是什么。 你能举一个降价的例子来说明你有什么,会发生什么,以及你对“文档末尾处的换行符”的期望吗?
There is a blank line in the text, which I hope can be eliminated.
Ah. That sounds more like you want to use remove-empty-lines-between-list-markers-and-checklists, but it also looks like you want blank lines removed between paragraph contents. The latter is currently not a feature the Linter provides, but for list items it can remove the lines. Though I see an odd character after the numbers in your list items. What character comes after the number 10 in your list item and is that valid markdown?
Thank you for taking the time to answer my questions!
The list is just a random excerpt of text to show the final result, so the number 10 is not important. I would prefer not to have any blank lines in the paragraph content. Initially, I thought that "line-break-at-document-end" meant adding a line break at the end of each line in the paragraph, which would achieve the effect I needed. However, I misunderstood it.
I can use other methods to remove blank lines, but it would be nice if linter could provide this feature.
Would it be a correct understanding that you are requesting that blank lines be removed from files so long as they are not in
- code blocks
- math blocks
This simple regex removes all blank lines:
There has not been much conversation around this in a while. It looks like this already has a solution via custom regex replacement, so I am going to close this issue. We can reopen the issue if there is a desire to do so.