在字符串中间格式化句子

时间:2019-06-24 18:49:51

标签: javascript reactjs redux

我当前正在尝试将字符串中间的一个句子变为斜体。这是在redux中创建的形式的段落。此表单架构中没有html元素。创建具有所有表单内容的对象,然后将其传递到redux以显示具有相应文本的所有字段。

到目前为止,我已经尝试使用字符串插值来实现html标签,并且还尝试使用转义码()。

sectionPageTitle: "About",
sectionClass: "section-about",
sectionMeta: [
  {
    pageMeta: [
      {
        subsectionTitle: "WHO SHOULD USE THIS FORM?",
        subsectionMeta: [
          {
            paragraph:
              "There was a boy named Tom and he has blue hair. He has a sister and 2 dogs. One day Tom decided to buy a skateboard but his mom said no. Tom didn't care and bought one anyways. The next day he broke his arm."
          }
        ]
      }

我只想将“ Tom不在乎并反正购买了”这一句改为斜体。

0 个答案:

没有答案