Filter #<weight>...</weight> from metadata (#3741)
This commit is contained in:
parent
d001d8e83d
commit
44d8aa962e
@ -46,11 +46,12 @@ function formatMeta (meta?: Meta): React.ReactNode | null {
|
||||
|
||||
const strings = meta.documentation.map((doc) => doc.toString().trim());
|
||||
const firstEmpty = strings.findIndex((doc) => !doc.length);
|
||||
const parts = splitParts((
|
||||
const combined = (
|
||||
firstEmpty === -1
|
||||
? strings
|
||||
: strings.slice(0, firstEmpty)
|
||||
).join(' ').replace(/\\/g, '').replace(/`/g, ''));
|
||||
).join(' ').replace(/#(<weight>| <weight>).*<\/weight>/, '');
|
||||
const parts = splitParts(combined.replace(/\\/g, '').replace(/`/g, ''));
|
||||
|
||||
return <>{parts.map((part, index) => index % 2 ? <em key={index}>[{part}]</em> : <span key={index}>{part}</span>)} </>;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user