Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add DOCX reader to support row head #9496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/Text/Pandoc/Readers/Docx/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ data BodyPart = Paragraph ParagraphStyle [ParPart]

type TblGrid = [Integer]

newtype TblLook = TblLook {firstRowFormatting::Bool}
newtype TblLook = TblLook {firstRowFormatting::Bool, firstColumnFormatting::Bool}
deriving Show

defaultTblLook :: TblLook
defaultTblLook = TblLook{firstRowFormatting = False}
defaultTblLook = TblLook{firstRowFormatting = False, firstColumnFormatting = False}

data Row = Row TblHeader [Cell] deriving Show

Expand Down Expand Up @@ -685,8 +685,15 @@ elemToTblLook ns element | isElem ns "w" "tblLook" element =
Nothing -> case val of
Just bitMask -> testBitMask bitMask 0x020
Nothing -> False
firstColumnFmt =
case firstColumn of
Just "1" -> True
Just _ -> False
Nothing -> case val of
Just bitMask -> testBitMask bitMask 0x020
Nothing -> False
in
return TblLook{firstRowFormatting = firstRowFmt}
return TblLook{firstRowFormatting = firstRowFmt, firstColumnFormatting = firstColumnFmt}
elemToTblLook _ _ = throwError WrongElem

elemToRow :: NameSpaces -> Element -> D Row
Expand Down
Loading