hieuthi / joplin-plugin-markdown-table-sortable

Add the ability to sort rendered tables on the fly
MIT License
22 stars 2 forks source link

Problem Sorting IP Addresses #6

Open ISSchuster opened 3 months ago

ISSchuster commented 3 months ago

Hi, great plugin but there is a problem sorting IP Addresses...

Follwing Table:

Server IP User Password
server01 10.61.5.234 root 123456
server02 10.61.5.232 root 123456
server03 10.61.5.231 root 123456
server04 10.61.5.235 root 123456
server05 10.61.5.236 root 123456
server06 10.61.5.237 root 123456

Sorting by IP results in: 10.61.5.234 10.61.5.232 10.61.5.231 10.61.5.235 10.61.5.236 10.61.5.237

or

10.61.5.237 10.61.5.236 10.61.5.235 10.61.5.231 10.61.5.232 10.61.5.234

Doesn't seem quiet right ;-) Any idea for a solution.

Seems it doesn't get sorted at all - even as text it should be sorted correctly?

I often have lists with IP Addresses and would like to sort them.

Thanks.

Just did some more tests: I replaced the . with a - 10-61-5-234 and so on is sorted correctly... But that's not an IP anymore ;-)

hieuthi commented 3 months ago

This plugin uses an open source library that has a very naive method of determining whether a column is text, number or date string so it interpreted IP as number. Of course I could write the logic myself but that would create more works for me and IP is kinda niche data, so there is nothing I could do at the moment.

That being said, I will leave this issue open and may get back to it at a later date when I have some free time to spend on this.