Did not test this but it might work to use the CKEditor widget from the appstore.
This widget will display html correctly.
Give it a try: https://appstore.home.mendix.com/link/app/1715/Mendix/CKEditor-For-Mendix
Thank you Erwin, the CKEditor viewer works exactly liked needed.
Now I'm just struggling with the interaction between the CKEditor viewer widget and the HTML snippet.
Can anybody see why it's not working?
CKEditor viewer
Name: cKEditorViewerForMendix1
Output as shown by Chrome inspector:
HTML snippet
HTML snippet full code
jQuery(".mx-name-cKEditorViewerForMendix1 div label span").on("click", function () {
//We extract the text from the element clicked - Works for <p> elements, to be tested on <span>
var microflowInputString = jQuery(this).text();
//We create a new object of a new entity because the Mendix client API doesn't have an interface for strings being given as an input into microflows
mx.data.create({
entity: '<Data_Import>.<LookupValue>',
callback: function (obj) {
//We set the word from the form as an attribute part of your new entity, I used "Word" as an example, make sure this matches your new entity
obj.set('Value', microflowInputString);
mx.data.action({
params: {
applyto: "selection",
actionname: "<Breakdown>.<ACT_LookupWord>",
guids: [obj.getGuid()],
origin: this.mxform
},
error: function (error) {
alert(error.description);
}
});
},
error: function (e) {
console.log('an error occured: ' + e);
}
});
});
Other info
ACT_LookupWord: Microflow to translate a word. Triggered by clicking a word in the text.
Breakdown: Module containing ACT_Lookupword microflow
Value: input paramater for the ACT_LookupWord microflow
LookupValue: Entity containing Value attribute
Data_import: module containing lookupvalue entity