git.iko.soy/typeable/pandoc
on master help sign in
Docx Reader: parse `moveTo` and `moveFrom`

`moveTo` and `moveFrom` are track-changes tags that are used when a block of text is moved in the document. We now recognize these tags and treat them the same as `insert` and `delete`, respectively. So, `--track-changes=accept` will show the moved version, while `--track-changes=reject` will show the original version.

commita385ee1d4fad05eb2cd45a9206182e90cd856012 authorJesse Rosenthal <jrosenthal@jhu.edu> dateFri 15 Apr 2016, 14:09 (11 years ago) parent4b49f92
1 file changed+2−2
src/Text/Pandoc/Readers/Docx/Parse.hs+2−2
src/Text/Pandoc/Readers/Docx/Parse.hs+2−2
@@ -661,14 +661,14 @@ elemToParPart ns element
661661 | isElem ns "w" "r" element =
662662 elemToRun ns element >>= (\r -> return $ PlainRun r)
663663elemToParPart ns element
664− | isElem ns "w" "ins" element
664+ | isElem ns "w" "ins" element || isElem ns "w" "moveTo" element
665665 , Just cId <- findAttr (elemName ns "w" "id") element
666666 , Just cAuthor <- findAttr (elemName ns "w" "author") element
667667 , Just cDate <- findAttr (elemName ns "w" "date") element = do
668668 runs <- mapD (elemToRun ns) (elChildren element)
669669 return $ Insertion cId cAuthor cDate runs
670670elemToParPart ns element
671− | isElem ns "w" "del" element
671+ | isElem ns "w" "del" element || isElem ns "w" "moveFrom" element
672672 , Just cId <- findAttr (elemName ns "w" "id") element
673673 , Just cAuthor <- findAttr (elemName ns "w" "author") element
674674 , Just cDate <- findAttr (elemName ns "w" "date") element = do