Docx reader: use all anchor spans for header ids.

Previously we only used the first anchor span to affect header ids. This
allows us to use all the anchor spans in a header, whether they're
nested or not.

Along with 62882f97, this closes #3088.
This commit is contained in:
Jesse Rosenthal 2016-08-28 18:12:02 -04:00
parent 2893b0055a
commit 9f6fd6139f

View file

@ -441,7 +441,7 @@ makeHeaderAnchor' (Header n (ident, classes, kvs) ils)
newIls = concatMap f ils where f il | il == c = cIls
| otherwise = [il]
modify $ \s -> s {docxAnchorMap = M.insert anchIdent newIdent hdrIDMap}
return $ Header n (newIdent, classes, kvs) newIls
makeHeaderAnchor' $ Header n (newIdent, classes, kvs) newIls
-- Otherwise we just give it a name, and register that name (associate
-- it with itself.)
makeHeaderAnchor' (Header n (ident, classes, kvs) ils) =