cannibalox / logseq-custom-files

logseq custom.js and custom.css utilities : resize query table columns, hide namespaces prefixes, better-sidebar......
MIT License
98 stars 17 forks source link

Possible improvement #2

Closed dominiwe closed 2 years ago

dominiwe commented 2 years ago

Hey!

I think that in the script to make the namespaces shorter there is a part which doesn't work. In the file custom.js at this line you have 'a.page-ref[data-ref*="/"]:not(.hidden-namespace)'. If I understand it correctly, the :not(.hidden-namespace) part should ensure that nodes with that class are not selected.

But when I put a console.log(nmsp) right after that part it logged a NodeList which still included all the nodes with that class.

So I think maybe what happens is that the script processes every node everytime it runs. I'm not entirely sure though, just thought I'd point it out.

dominiwe commented 2 years ago

Ooh I think I am wrong, my mistake! I guess the script added the class and that's why it was visible when the console printed it. Sorry for creating the issue.