Add rowspan, colspan and alignment to cells in jats table reader #8724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I'm looking for some guidance on completing this code change. This is my first time writing Haskell code and I'm getting stuck on some code and I can't tell if my design is wrong/bad or if I'm just missing something syntactically or conceptually.
My issue is arising from trying to parse the xml
Element
attributes at the same time as when we parse the content of theElement
itself, so when we create aCell
, we have all of the information we need.The previous design of the code just parsed the xml row
Element
s intoBlocks
and then madesimpleCell
s (which don't accept rowspan, colspan or alignment attributes) from thoseBlocks
.So, I'm getting stuck with a typing/monad issue. I'm able to parse out the
colspan
,rowspan
andalignment
attributes from the xml and push those values into cells, but I'm having a heard time usingparseMixed
to parse anElement
intoBlocks
.parseMixed
returns the typeStateT JATSState Blocks
. What would be an idiomatic way to get theBlocks
value out of theStateT JATSState
monad that is returned by this function?I also realize that because I'm new to Haskell and Pandoc that my approach to this problem may be way off base, so any direction there would be welcome as well!