feat: fix validation
This commit is contained in:
parent
914d0376c4
commit
3ef1bf8365
|
|
@ -17,7 +17,7 @@ export const GeneralPreviewComponent: FC<{
|
|||
const mediaDir = useMediaDirectory();
|
||||
|
||||
const renderContent = topValue.map((p) => {
|
||||
const newContent = stripHtmlValidation('plain', p.content, true)
|
||||
const newContent = stripHtmlValidation('html', p.content, true)
|
||||
.replace(/(@.+?)(\s)/gi, (match, match1, match2) => {
|
||||
return `<span class="font-bold" style="color: #ae8afc">${match1.trim()}${match2}</span>`;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -132,12 +132,12 @@ const underlineMap = {
|
|||
};
|
||||
|
||||
export const stripHtmlValidation = (
|
||||
type: 'plain' | 'none' | 'normal' | 'markdown' | 'html',
|
||||
type: 'none' | 'normal' | 'markdown' | 'html',
|
||||
value: string,
|
||||
replaceBold = false,
|
||||
none = false
|
||||
): string => {
|
||||
if (type === 'plain') {
|
||||
if (type === 'html') {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue