Open ChristophWurst opened 1 year ago
@julien-nc is there documentation on what one can expect as a result of a resource/smart picker?
https://github.com/julien-nc/text_templates/blob/da772a1fee566db486b45f247cc327acdf936344/src/views/TemplateCustomPickerElement.vue#L149 I think this is where the value is emitted when picked
Ideally we should get meta info about the type of value inside the string. Then we can make links real links in HTML messages, and convert text to HTML to preserve line break.
Mail 3.0 is in RC so this will be fixed with 3.1 at the earliest
@julien-nc :ping_pong: :)
@julien-nc is there documentation on what one can expect as a result of a resource/smart picker?
Not yet. And for the moment, the picker providers just return text. They don't have any way to specify any type.
If we pass anything else than a string as the event data, it will break the picker integration in Text, Talk etc... So the picker could listen to another event ('submit-richobject' for example) which would be emitted by the providers and which would have an object as data. Something like:
{ type: 'text/markdown', content: '### Intro\nblabla' }
I think it's better than asking each integrator (Mail, Text, Talk...) to check if they got a string or an object as picker result.
What do you think?
cc @juliushaertl
Alright. Then let's HTML-encode the text to preserve line breaks. I hope this doesn't break integration of link pickers.
Sometimes the provider does not even know which type it returns. The OpenAI's GPT one can be asked to return anything by the user depending on the query. Same for the text template one, we don't know what the user has set as template contents.
How does https://nextcloud-vue-components.netlify.app/#/Components/NcRichText treat the picker result? Insert as-is or convert to HTML for the editable div?
It inserts an HTML text node with the picker result as content: https://github.com/nextcloud/nextcloud-vue/blob/master/src/components/NcRichContenteditable/NcRichContenteditable.vue#L426-L431
Steps to reproduce
Expected behavior
Line breaks are preserved
Actual behavior
Line breaks do not show as such
Mail app version
3.0
Mailserver or service
No response
Operating system
No response
PHP engine version
None
Web server
None
Database
None
Additional info
No response