text
text copied to clipboard
Add new features to RichTextReader
Describe the bug We need to add the new Text features to RichTextReader in order to use them in read-only mode (e.g. in Collectives):
- [x] rendering of user mentions (#2970)
- [ ] rendering of file attachments
- [ ] attributes for page anchor links
Good catch, is there any way we can unify the implementation so that future features would be implemented right away?
For now, the way to go is to implement them in RichText.js instead of EditorFactory.js. That way, they will be part of both RichTextReader.vue and Editor.vue. If they contain features that are only needed for the Editor though, we need to make sure that these parts are only loaded in EditorFactory.js and not in RichText.js (e.g. see EditableTable.js vs. Table.js).
I'm sure there's smarter solutions to this :blush:
File attachments are rendered as images that were failed to load in RichTextReader.vue at the moment. The reason is that we don't pass the session as a property to AttachmentResolver in Collectives.
Images are still loaded because we have a fallback mechanism for them (they're requested via the DAV url if session is unset).
Maybe something to discuss next week @max-nextcloud @vinicius73 and @eneiluj.
Heading anchor attributes will be fixed by https://github.com/nextcloud/text/pull/3345.
Added https://github.com/nextcloud/text/pull/2977 to the list