Closed jjaychen1e closed 2 years ago
And, although other properties begin with a white space, but it seems "\b[^:]+:: [^\n]+" will match all content. If this is also confirmed as a bug, another PR is needed.
我在我的Logseq上测试了一下,没有发现collapsed
是紧挨着内容的情况,都是另起一行的。你用的是什么版本的Logseq?在什么操作系统上?
我在我的Logseq上测试了一下,没有发现
collapsed
是紧挨着内容的情况,都是另起一行的。你用的是什么版本的Logseq?在什么操作系统上?
Logseq 0.5.6, macOS
And it works well if there are only Chinese characters because "\b" won't match Chinese characters.
I reproduced the issue, it's the regular expression that handles the properties that is not working properly, I fixed the problem and released a new version, please give it try.
I reproduced the issue, it's the regular expression that handles the properties that is not working properly, I fixed the problem and released a new version, please give it try.
It doesn't fix my problem in my test. And I create another commit, hiding the arrow if there is no sub "h" child block in "h" mode.
Can you send me a snippet of your markdown? It helps me track down the problem. BTW, I’ll take a look of the PR tomorrow.
在 2022年1月3日,21:17,JJAYCHEN @.***> 写道:
I reproduced the issue, it's the regular expression that handles the properties that is not working properly, I fixed the problem and released a new version, please give it try.
It doesn't fix my problem in my test. And I create another commit, hiding the arrow if there is no sub "h" child block in "h" mode.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.
Can you send me a snippet of your markdown? It helps me track down the problem. BTW, I’ll take a look of the PR tomorrow. … 在 2022年1月3日,21:17,JJAYCHEN @.***> 写道: I reproduced the issue, it's the regular expression that handles the properties that is not working properly, I fixed the problem and released a new version, please give it try. It doesn't fix my problem in my test. And I create another commit, hiding the arrow if there is no sub "h" child block in "h" mode. — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.
Thanks. Here is a test markdown snippet:
- {{renderer(:tocgen,[[TOC Test]])}}
- # Title
- ## English Subtitle
- something...
- ## 中文标题
- 内容
- ## English + 中文标题
- something
This snippet is placed in a page named "TOC Test", and tocgen is configured in "h" mode. And here is a recorded video:
Thanks for contributing! I integrated your code and made some refactorings. It should be now fix your issues.
Thanks for contributing! I integrated your code and made some refactorings. It should be now fix your issues.
Thanks for reply. In my test, the newest version still shows collapse arrow even there are no more sub "h" blocks in "h" mode, if I set the default value of collapse property to false
:
https://github.com/sethyuan/logseq-plugin-tocgen/blob/0a8b9ecf1ddc00dfd754ba861d6e5842a6b1075e/public/comps/Block.jsx#L33
Thanks for contributing! I integrated your code and made some refactorings. It should be now fix your issues.
Thanks for reply. In my test, the newest version still shows collapse arrow even there are no more sub "h" blocks in "h" mode, if I set the default value of collapse property to
false
:
Maybe we can control this in a separate "opacity" CSS style?
And this doesn't work: https://github.com/sethyuan/logseq-plugin-tocgen/blob/f3f28a596f0e8aea4c5c30cde6f7860fb6ed8168/public/marked-renderer.js#L43
And I try to put htmlDecode(text)
into:
https://github.com/sethyuan/logseq-plugin-tocgen/blob/f3f28a596f0e8aea4c5c30cde6f7860fb6ed8168/public/marked-renderer.js#L38
It works.
@JJAYCHEN1e The collapse behavior is intentional. It's there to make level indentation more apparent.
As for htmlDecode
, I should've placed it for text
instead of paragraph
, that would cover both heading and paragraph cases. I released a new version with this patch.
When a block is collapsed, the TOC will be incomplete. Here is the explanation:
When a block is collapsed, the "collapsed" properly doesn't begin with a white space, for example, a collapsed block with content "somewords" could be: "somewordscollapsed:: true". In this case, "somewordscollapsed:: true" will entirely be replaced with empty string.