mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-11 11:47:40 +03:00
fix rendering of UNDERLINE inline style in RTE
This commit is contained in:
parent
3a07fc1601
commit
feac919c0a
1 changed files with 9 additions and 1 deletions
|
@ -30,7 +30,15 @@ const USERNAME_REGEX = /@\S+:\S+/g;
|
|||
const ROOM_REGEX = /#\S+:\S+/g;
|
||||
const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp, 'g');
|
||||
|
||||
export const contentStateToHTML = stateToHTML;
|
||||
export const contentStateToHTML = (contentState: ContentState) => {
|
||||
return stateToHTML(contentState, {
|
||||
inlineStyles: {
|
||||
UNDERLINE: {
|
||||
element: 'u'
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export function HTMLtoContentState(html: string): ContentState {
|
||||
return ContentState.createFromBlockArray(convertFromHTML(html));
|
||||
|
|
Loading…
Reference in a new issue