title: Recovering old tag with difflib
body: <p>I am trying to recover a series of xml tags from an old version of a text (text1) and embed them in the newest version of the same text (text2).</p>
  
  <p>For example:</p>
  
  <pre><code>text1 = "this &lt;verb&gt;is&lt;/verb&gt; an example of a sentence"
  
  text2 = "this is an &lt;noun&gt;example&lt;/noun&gt; of a &lt;noun&gt;sentence&lt;/noun&gt;"
  
  desired_output = "this &lt;verb&gt;is&lt;/verb&gt; an &lt;noun&gt;example&lt;/noun&gt; of a &lt;noun&gt;sentence&lt;/noun&gt;"
  </code></pre>
  
  <hr>
  
  <p>For now I have managed using difflib to print both versions seperately with the code:</p>
  
  <pre><code>diff = difflib.unified_diff(text1, text2, lineterm='')
  print ('\n'.join(list(diff)))
  </code></pre>
  
  <p>Which gives:</p>
  
  <pre><code>- this &lt;verb&gt;is&lt;/verb&gt; an example of a sentence
  + this is an &lt;noun&gt;example&lt;/noun&gt; of a &lt;noun&gt;sentence&lt;/noun&gt;
  </code></pre>
  
  <p>My question is, how can I embed the <code>-</code> string into the <code>+</code> string?</p>