title: How to format numbers coming from an endpoint in my SwiftUI View?
body: <p>I'm receiving data from my endpoint in this json format:</p>
  <pre><code>[
      {
          &quot;id&quot;: 1,
          &quot;chapter_content_combined&quot;: &quot;*1* No princípio Deus criou os céus e a terra. *2* Era a terra sem forma e vazia; trevas cobriam a face do abismo, e o Espírito de Deus se movia sobre a face das águas. *3* Disse Deus: \&quot;Haja luz\&quot;, e houve luz. *4* Deus viu que a luz era boa, e separou a luz das trevas....&quot;,
          &quot;chapter&quot;: 1,
          &quot;verses_amount&quot;: 31,
          &quot;book&quot;: 1
      },
      {
          &quot;id&quot;: 2,
          &quot;chapter_content_combined&quot;: &quot;*1* Assim foram concluídos os céus e a terra, e tudo o que neles há. *2* No sétimo dia Deus já havia concluído a obra que realizara, e nesse dia descansou. *3* Abençoou Deus o sétimo dia e o santificou, porque nele descansou de toda a obra que realizara na criação....&quot;,
          &quot;chapter&quot;: 2,
          &quot;verses_amount&quot;: 25,
          &quot;book&quot;: 1
      },
  ]
  </code></pre>
  <p>And then I'm just outputting it in my View like this:</p>
  <pre><code>List {
    ForEach(self.viewModel.chapters) { chapter in
      Text(chapter.chapter_content_combined)
    }
  }
  </code></pre>
  <p>The output in the canvas looks like this:</p>
  <p><a href="https://i.stack.imgur.com/916U2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/916U2.png" alt="enter image description here" /></a></p>
  <p>How can I format the <code>**</code> parts from the JSON (all numbers, <code>*1*, *2*, *3*</code> etc) to be superscripted (and colored), kinda like this:</p>
  <p>(notice the orange, tiny superscript numbers):</p>
  <p><a href="https://i.stack.imgur.com/5dWEx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5dWEx.jpg" alt="enter image description here" /></a></p>
  <p>I assume I'm gonna have to tap into UIKit for this, not sure how to proceed</p>
  <p>I did manage to use Regex to filter out the <code>**</code> parts, but not sure how to proceed with it, or if there is a better approach</p>
  <pre><code>if let regex = try? NSRegularExpression(pattern: &quot;\\*([^\\*]*)\\*&quot;, options: .caseInsensitive) {
      let modChapter = regex.stringByReplacingMatches(in: chapter, options: [], range: NSRange(location: 0, length:  chapter.count), withTemplate: &quot;&quot;) // not sure what to do with this though
      print(modChapter)
  }
  </code></pre>