chore: code refactoring (#5928)
* chore: de dupe code splitting * chore: code refactor
This commit is contained in:
parent
4bc751b7ab
commit
57eb08c8a2
21 changed files with 664 additions and 250 deletions
|
|
@ -265,3 +265,11 @@ export const replaceCustomComponentsFromMarkdownContent = (props: {
|
|||
parsedMarkdownContent = parsedMarkdownContent.replace(issueEmbedRegex, "");
|
||||
return parsedMarkdownContent;
|
||||
};
|
||||
|
||||
export const getTextContent = (jsx: JSX.Element | React.ReactNode | null | undefined): string => {
|
||||
if (!jsx) return "";
|
||||
|
||||
const div = document.createElement("div");
|
||||
div.innerHTML = jsx.toString();
|
||||
return div.textContent?.trim() ?? "";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue