You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
fix rendering of UNDERLINE inline style in RTE
This commit is contained in:
@@ -30,7 +30,15 @@ const USERNAME_REGEX = /@\S+:\S+/g;
|
|||||||
const ROOM_REGEX = /#\S+:\S+/g;
|
const ROOM_REGEX = /#\S+:\S+/g;
|
||||||
const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp, '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 {
|
export function HTMLtoContentState(html: string): ContentState {
|
||||||
return ContentState.createFromBlockArray(convertFromHTML(html));
|
return ContentState.createFromBlockArray(convertFromHTML(html));
|
||||||
|
|||||||
Reference in New Issue
Block a user