1

Hi I'm getting data (a table) as a markdown and displaying it thru ReactMarkdown but i want to extract specific fields lets say I have a markdown like this:

[ { "type": "markdown", "data": "| test | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |\n|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|\n| Test1/ Test2| Not Needed | Not Needed | Not Needed | Not Needed | Not Needed | | | | |\n| Test3/ Test4| | | | | | Not Needed | Not Needed | Not Needed | Not Needed |\n| | | | | | | | | | |" } ]

From this I want to extract the 1 2 3 4 5 6 7 8 and 9 which are displayed thru ReactMarkdown as <thead><td>...<td></thead>

So is there a way with document.querySelector to fetch that specific data or any other way. Any help would be great, thanks in advance

Vedo
  • 976
  • 4
  • 21
  • By "extract" what do you mean? Are you asking how to remove that text from the `data` string so that it doesn't appear in the final table rendered by ReactMarkdown? – Andy Jun 05 '23 at 14:21
  • By extract i mean get lets say a new constant which is an array of those elements. Like I mentioned above 1,2,3,4 etc – Vedo Jun 05 '23 at 19:28

0 Answers0