title: Python bs4 removes br tag
body: <p>I use bs4 to manipulate some rich-text. but it removes br tag inside where i did character conversion. below is the simple form of the code.</p>
  
  <pre><code>import re
  from bs4 import BeautifulSoup
  
  #source_code = self.textInput.toHtml()
  source_code =  """.......&lt;p style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;span style=" font-family:'Ubuntu';"&gt;ABC ABC&lt;br /&gt;ABC&lt;/span&gt;&lt;/p&gt;.......""" 
  
  soup = BeautifulSoup(source_code, "lxml")
  
  for elm in soup.find_all('span', style=re.compile(r"font-family:'Ubuntu'")):
  #actually there was a for loop
      elm.string = elm.text.replace("A", "X")
      elm.string = elm.text.replace("B", "Y")
      elm.string = elm.text.replace("C", "Z")
  
  print(soup.prettify())
  </code></pre>
  
  <p>this should give an output as</p>
  
  <pre><code>...&lt;span style=" font-family:'Ubuntu';"&gt;XYZ XYZ&lt;br /&gt;XYZ&lt;/span&gt;...
  #XYZ XYZ
  #XYZ
  </code></pre>
  
  <p>but it gives output without br tag.</p>
  
  <pre><code>...&lt;span style=" font-family:'Ubuntu';"&gt;XYZ XYZXYZ&lt;/span&gt;...
  #XYZ XYZXYZ
  </code></pre>
  
  <p>how can i correct this?</p>