title: Modify the format of a portion of a flextable cell
body: <p>I want to modify the format of a portion of a cell, while leaving the remaining text unmodified for inclusion in a .docx report:<br>
  e.g., Brill (<em>Scophthalmus rhombus</em>) in subdivisions 22-32 (Baltic Sea) </p>
  
  <p>My data is set up with HTML tags, which I have been trying to modify using the <code>display()</code> function. My example (somewhat obviously) modifies the entire cell. I expect that the <code>pattern</code> argument can be modified with <code>{{moustaches}}</code> to make the nested formatting possible, but I haven't had any luck. </p>
  
  <pre><code>library(flextable)
  library(officer)
  library(dplyr)
  
  data &lt;- structure(list(Description = c("Brill (&lt;em&gt;Scophthalmus rhombus&lt;/em&gt;) in subdivisions 22-32 (Baltic Sea)", 
                                         "Cod (&lt;em&gt;Gadus morhua&lt;/em&gt;) in subdivisions 22-24, western Baltic stock (western Baltic Sea)", 
                                         "Cod (&lt;em&gt;Gadus morhua&lt;/em&gt;) in subdivisions 25-32, eastern Baltic stock (eastern Baltic Sea)", 
                                         "Dab (&lt;em&gt;Limanda limanda&lt;/em&gt;) in subdivisions 22-32 (Baltic Sea)", 
                                         "Flounder (&lt;em&gt;Platichthys flesus&lt;/em&gt;) in subdivisions 22 and 23 (Belt Seas and the Sound)", 
                                         "Flounder (&lt;em&gt;Platichthys flesus&lt;/em&gt;) in subdivisions 24 and 25 (west of Bornholm and southwestern central Baltic)"),
                         SpeciesScientificName = c("Scophthalmus rhombus", "Gadus morhua", "Gadus morhua", "Limanda limanda", "Platichthys flesus", "Platichthys flesus")),
                    .Names = c("Description", "SpeciesScientificName"), 
                    row.names = c(NA, 6L), class = "data.frame")
  
  data %&gt;% 
    mutate(Description = gsub("&lt;em&gt;.*?&lt;/em&gt;", "%s", Description)) %&gt;%
    flextable() %&gt;% 
    display(col_key = "Description", pattern = "{{sp_italics}}",
            formatters = list(sp_italics ~ sprintf(Description, SpeciesScientificName)),
            fprops = list(sp_italics = fp_text(italic = TRUE)))
  </code></pre>