const array = [
{ text: "a", style: { bold: true }},
{ text: "b", style: { bold: true }},
{ text: "c", style: { italic: true, bold: true }},
{ text: "d", style: { italic: true }},
{ text: "e", style: { italic: true }},
{ text: "f", style: { underline: true }},
]
an array like this,
expects it to be formatted like this
const formatArray = [
{ text: "ab", style: { bold: true }},
{ text: "c", style: { italic: true, bold: true }},
{ text: "de", style: { italic: true }},
{ text: "f", style: { underline: true }},
]
splices the text values according to the exact same style attribute. Text has an order requirement, that is, the index of the array, so only adjacent elements with the same style attribute are merged.
ask Daniel to give me some advice!