Skip to content
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

HTML export with clickable urls #253

Closed
jathri opened this issue Oct 16, 2024 · 4 comments
Closed

HTML export with clickable urls #253

jathri opened this issue Oct 16, 2024 · 4 comments
Labels
awaiting response Further information is requested enhancement New feature or request

Comments

@jathri
Copy link

jathri commented Oct 16, 2024

Thank you for #251 again! Have another feature proposal. Another part of "convenience package" ;) Can it be implemented sometime? Since Signal desktop app contains clickable links as well. Perhaps it can be yet another switch.

@bepaald bepaald added the enhancement New feature or request label Oct 17, 2024
@bepaald
Copy link
Owner

bepaald commented Oct 17, 2024

Yeah sure. This was always planned, but it quickly dropped in priority on the (back then) long to-do list when I discovered how difficult it was :-). Things have slowed down enough to tak e another crack at it though.

I actually believe I have something working now (locally), it's not perfect, but I think it works the same as Signal's linkify function (it's more or less copied from Android Open Source Project).

When I find some time (I'll be busy for the next few days), I will clean my code up and then find some way to integrate it with the project. I'll get back to you when it's done.

Thanks!

bepaald added a commit that referenced this issue Oct 20, 2024
…_folder(_membership) tables. First attempt at --linkify (HTML export, see #253). Update HTML settings. Remove lazy loading
@bepaald
Copy link
Owner

bepaald commented Oct 21, 2024

There is now initial support for this. This one was quite difficult, it could do with a lot of thorough testing.

Notes:

  • There are known valid URL that aren't detected. I think (hope?) they are rare, and Signal does not detect them either, but still. (For example, none of the URLs mentioned here are linkified).
  • There are some false hits, at least in my backup, around typos where erroneous .'s are present. Again, Signal does this too, and there is not really an issue (the tool simply can't know the intention of the user).
  • When links without a protocol are present (www.example.com), these would normally be interpreted as relative paths to the current location. Normally, this can be worked around by prepending //, but that would default to the current protocol, which in this case would be file://, which would not be correct. I'm therefor always prepending protocol-less URLs with https://. This could produce dead links if the target does not support https. Again, I see no way around this.

For testing, please try to just look at as many URLs as you can (I realize manually checking each individual one in a backup could be too much, depending on the backup's size). Also, if possible pass the generated HTML through a validator (W3C). During development there were many difficulties when links were combined with text formatting (bold, italics) or multiwidth unicode characters (both around, and in the URL). This could lead to invalid HTML, or to the link tags (<a>) being at an offset from the actual link text (www.example.com).

The feature is currently behind --linkify. If it turns out to work properly, I will probably have that default true in the near future (to be disabled by --no-linkify), but for now it needs to be enabled explicitly.

Thanks!

@bepaald bepaald added the awaiting response Further information is requested label Oct 27, 2024
@bepaald
Copy link
Owner

bepaald commented Nov 4, 2024

I bit the bullet and made --linkify default. Thanks again!

@bepaald bepaald closed this as completed Nov 4, 2024
@jathri
Copy link
Author

jathri commented Nov 22, 2024

Just tried it and looking good :)

I think it works the same as Signal's linkify function (it's more or less copied from Android Open Source Project).

Consider this right approach. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Further information is requested enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants