title: Replace html tags in text with formatting in PhpWord
body: <p><strong>What I have:</strong></p>
  <ul>
  <li>template document <code>template.docx</code> with mark inside - <code>${position_to_insert_text}</code></li>
  <li>string in variable <code>$text_to_insert_in_template</code> with <code>&lt;strong&gt;</code> html tags inside - <code>My &lt;strong&gt;example string&lt;/strong&gt; with html tag.</code></li>
  </ul>
  <p><strong>What I want:</strong></p>
  <ul>
  <li>Open template <code>template.docx</code></li>
  <li>replace <code>${position_to_insert_text}</code> with <code>$text_to_insert_in_template</code></li>
  <li>inserted text between <code>&lt;strong&gt;</code> and <code>&lt;/strong&gt;</code> tags must be strong formatted - My <strong>example string</strong> with html tag.</li>
  </ul>
  <p><strong>What I do:</strong></p>
  <pre><code>$text_to_insert_in_template = 'My &lt;strong&gt;example string&lt;/strong&gt; with html tag.';
  $template_path = 'templates/template.docx';
  
  $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($template_path);
  $templateProcessor-&gt;setValue('position_to_insert_text', $text_to_insert_in_template);
  $templateProcessor-&gt;saveAs('result.docx');
  </code></pre>
  <p><strong>Result</strong>:</p>
  <p>Broken <code>result.docx</code> document without ability to open it. Reason - not handled html tags. If <code>htmlspecialchars($text_to_insert_in_template)</code> as result I can open <code>result.docx</code> but html tags displays as plain text.</p>
  <p>I try to replace html tags to native word tags</p>
  <pre><code>$text_to_insert_in_template = 'My &lt;strong&gt;example string&lt;/strong&gt; with html tag.';
  $template_path = 'templates/template.docx';
  
  $text_to_insert_in_template = str_replace('&lt;strong&gt;', &quot;&lt;w:b val='true'/&gt;&quot;, $text_to_insert_in_template);
  $text_to_insert_in_template = str_replace('&lt;/strong&gt;', &quot;&lt;w:b val='false'/&gt;&quot;, $text_to_insert_in_template);
  
  $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($template_path);
  $templateProcessor-&gt;setValue('position_to_insert_text', $text_to_insert_in_template);
  $templateProcessor-&gt;saveAs('result.docx');
  </code></pre>
  <p>As result I can open <code>result.docx</code>, but text inside has no formatting and html tags too:</p>
  <p><a href="https://i.stack.imgur.com/LLwMF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LLwMF.png" alt="enter image description here" /></a></p>
  <p>How can I get the result I want? - My <strong>example string</strong> with html tag.</p>