-
Notifications
You must be signed in to change notification settings - Fork 59
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
Automatically detect URLs and make them clickable in source publication field #457
Comments
Good idea. We already do this in notes: https://github.com/gramps-project/gramps-web/blob/main/src/components/GrampsjsNoteContent.js#L4-L12 So, should be straightforward to generalize. |
I did notice its already done in Notes. If you end up doing it for Gramps Web, is it easy to include in for example Narrative Web and Dynamic Web report too? Like could it maybe just be copy pasted in to those too? |
I realized this is a bit trickier than anticipated. For notes, we're injecting the anchor tags into the note HTML after rendering it. But this is only safe because note content is sanitized by the backend. For the other elements, they may contain unsafe HTML code in principle - this is not an issue because Lit will not render it as HTML. But if would use the same approach as in notes, we would have to render the raw (unsanitized) string which could contain malitious code. So this needs a bit more thought to implement in a safe way; either by sanitizing those elements in the backend or finding a way to use lit-html to replace the URLs. |
Nevermind, found a way 😉 |
Note complete - citation page & attribute values done, source publication missing. |
This is an extension of this feature request to other Gramps reports:
https://gramps-project.org/bugs/view.php?id=13337
It would be very nice if reports that show the citations/sources/attributes would detect URLs in the most common places to have them, and made them clickable.
This could potentially be done with detecting if there is a http:// or https:// or something like that and wrap it in a link tag. Unless that causes issues I cant think of.
I think some of the most common locations you may put URLs are:
Citation Volume/Page field.
Source Publication field.
Attributes, both on citation and sources
The text was updated successfully, but these errors were encountered: