Feature: user configurable list of allowed html tags in import #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An implementation of #567 whitelist html tags to keep on import.
Created a new configurable option for HTML import tags that:
Made the necessary backend changes:
I tested interactively by running Trilium in a devcontainer using the project docker-compose.yml (no changes outside of the code in this PR).
The feature is believed complete and working, with much help from Windsurf Cascade and Claude Sonnet 3.5. This is the first not-a-toy thing I've done in javascript/typescript, so take that into account during review.
Caveat
The whitelisted tags survive import but only last until the note is Edited, at which time the non-standard ones will be changed to
<p>
. So it's present value is in that the import more faithfully represents the source than before. Keeping them after edit too will mean (i assume) changing CKEditor behaviour. I might try look at that, but I expect it's a harder project than this one. so it might be awhile, if ever. (I really miss not having cite tags though, so who knows.)Example:
A onenote cite tag after import (with the change in this PR enabled) looks like:
After being edited the cite changes to: