mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 10:16:32 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user