Skip to content
  • Shawn Rutledge's avatar
    QTextMarkdownImporter: don't keep heading level on following list item · 7224d0e4
    Shawn Rutledge authored
    
    
    When reading a document like
    
     # heading
     - list item
    
    and then re-writing it, it turned into
    
     # heading
     - # list item
    
    because QTextCursor::insertList() simply calls QTextCursor::insertBlock(), thus
    inheriting block format from the previous block, without an opportunity to
    explicitly define the block format.  So be more consistent: use
    QTextMarkdownImporter::insertBlock() for blocks inside list items too.  Now it
    fully defines blockFormat first, then inserts the block, and then adds it to
    the current list only when the "paragraph" is actually the list item's text
    (but not when it's a continuation paragraph).  Also, be prepared for applying
    and removing block markers to arbitrary blocks, just in case (they might be
    useful for block quotes, for example).
    
    Change-Id: I391820af9b65e75abce12abab45d2477c49c86ac
    Reviewed-by: default avatarGatis Paeglis <gatis.paeglis@qt.io>
     
     
     
     
     
     
    7224d0e4