From a385ee1d4fad05eb2cd45a9206182e90cd856012 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Fri, 15 Apr 2016 14:09:18 -0400 Subject: 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. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index 364483929..7265ef8dd 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -661,14 +661,14 @@ elemToParPart ns element | isElem ns "w" "r" element = elemToRun ns element >>= (\r -> return $ PlainRun r) elemToParPart ns element - | isElem ns "w" "ins" element + | isElem ns "w" "ins" element || isElem ns "w" "moveTo" element , Just cId <- findAttr (elemName ns "w" "id") element , Just cAuthor <- findAttr (elemName ns "w" "author") element , Just cDate <- findAttr (elemName ns "w" "date") element = do runs <- mapD (elemToRun ns) (elChildren element) return $ Insertion cId cAuthor cDate runs elemToParPart ns element - | isElem ns "w" "del" element + | isElem ns "w" "del" element || isElem ns "w" "moveFrom" element , Just cId <- findAttr (elemName ns "w" "id") element , Just cAuthor <- findAttr (elemName ns "w" "author") element , Just cDate <- findAttr (elemName ns "w" "date") element = do -- cgit v1.2.3