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:
John MacFarlane
2026-05-12 15:33:45 +02:00
parent b754d4da68
commit 4e3707543b
+2 -2
View File
@@ -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