JSFiddle - React, Tailwind, and code Playground
by adelura
HTML
<!--
"Hello, World!"
[[0, 2 ,"i"],
[7, 11, "u"],
[4, 9, "b"]]
-->
JavaScript
function parse(text, styles) {
const testArr = Array.from(text);
const stack = [];
const stylesSorted = styles.slice().sort((a, b) => a[0] - b[0]);
const output = '';
textArr.forEach((char, index) => {
const startingStyles = styles.filter(([start, end, vale]) => start === index);
});
}