mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
Docx reader: fix bug in bitmask checking.
This led to some table rows being wrongly considered header rows. We now correctly handle the example from https://github.com/jgm/pandoc/issues/8299#issuecomment-4397472060 See #8299.
This commit is contained in:
@@ -67,7 +67,7 @@ import Control.Monad
|
||||
import Control.Monad.Except
|
||||
import Control.Monad.Reader
|
||||
import Control.Monad.State.Strict
|
||||
import Data.Bits ((.|.))
|
||||
import Data.Bits ((.&.))
|
||||
import qualified Data.ByteString.Lazy as B
|
||||
import Data.Char (chr, ord, readLitChar)
|
||||
import Data.List
|
||||
@@ -807,7 +807,7 @@ testBitMask :: Text -> Int -> Bool
|
||||
testBitMask bitMaskS n =
|
||||
case (reads ("0x" ++ T.unpack bitMaskS) :: [(Int, String)]) of
|
||||
[] -> False
|
||||
((n', _) : _) -> (n' .|. n) /= 0
|
||||
((n', _) : _) -> (n' .&. n) /= 0
|
||||
|
||||
pHeading :: ParagraphStyle -> Maybe (ParaStyleName, Int)
|
||||
pHeading = getParStyleField headingLev . pStyle
|
||||
|
||||
Reference in New Issue
Block a user