Hi Ezequiel,
Greetings from Syncfusion support.
We have validated your reported query "When I use the underline option from the toolbar it adds a html code like this one: "<span style="text-decoration: underline;">text</span>". I expected to see the html tag for underline: <u>"
By default RichTextEditor behavior, we have used the span elements for applying the inline styles but you can get the RichTextEditor value by converted span tag to underline tags.
We have prepared a sample for your reference. In this sample, we have changed span elements to underline elements manually.
Code snippets:app.component.ts
public OnClick(e) {
var value = this.replaceSpanToU(this.rteObj.getHtml());
alert(value);
}
public replaceSpanToU(input) {
return input.replace(
/\<span style\=\"text-decoration\: underline\;\"\>(.*?)\<\/span\>/g,
function(matched, index) {
return '<u>' + index + '</u>';
}
); } |
Sample: https://stackblitz.com/edit/angular-bevobh-rc5tsc?file=app.component.ts
please check the sample and let us know if the solution meets your requirement.
Regards,
Gunasekar