title: How to remove padding under last paragraph from NSAttributedString created from HTML using NSHTMLTextDocumentType
body: <p>When creating an <code>NSAttributedString</code> from HTML, using <code>NSHTMLTextDocumentType</code>, I'm finding it will add an <code>\n</code> for each paragraph even after the last paragraph. This is adding undesired padding underneath the last paragraph of text that's shown in a <code>UILabel</code>. How does one remove that extra padding for the last paragraph only?</p>
  
  <pre><code>NSString *style = @"&lt;style&gt; body { font-family: Avenir; font-size: 18px; color: blue; } p:last-of-type { margin: 0; }&lt;/style&gt;";
  NSString *html = @"&lt;p&gt;A whole bunch of sample text goes right here.&lt;/p&gt;&lt;p&gt;Now here's another paragraph that unfortunately has an extra line underneath the text adding undesired padding to the label. :(&lt;/p&gt;";
  NSString *styledHtml = [NSString stringWithFormat:@"%@%@", style, html];
  
  self.label.attributedText = [[NSMutableAttributedString alloc] initWithData:[styledHtml dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/X2OPT.png"><img src="https://i.stack.imgur.com/X2OPT.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/TEMAY.png"><img src="https://i.stack.imgur.com/TEMAY.png" alt="enter image description here"></a></p>