git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3166 from hubertp-lshift/bug/3134

Issue 3143: Don't duplicate text for anchors

commit4a2a7a21e5e8bf0d11abd214d372729eb9eb8d0c authorJohn MacFarlane <jgm@berkeley.edu> dateTue 18 Oct 2016, 22:03 (10 years ago) parent0cd11b3c74c5fd
3 files changed+3−4
src/Text/Pandoc/Readers/Odt/ContentReader.hs+2−3 tests/odt/native/referenceToText.native+1−1 tests/odt/odt/referenceToText.odt
src/Text/Pandoc/Readers/Odt/ContentReader.hs+2−3
@@ -810,9 +810,8 @@ maybeAddAnchorFrom anchorReader =
810810 >>>
811811 proc (inlines, fAnchorElem) -> do
812812 case fAnchorElem of
813− Right anchorElem ->
814− arr (anchorElem <>) -<< inlines
815− Left _ -> returnA -< inlines
813+ Right anchorElem -> returnA -< anchorElem
814+ Left _ -> returnA -< inlines
816815 where
817816 toAnchorElem :: Anchor -> Inlines
818817 toAnchorElem anchorID = spanWith (anchorID, [], []) mempty
tests/odt/native/referenceToText.native+1−1
@@ -1 +1 @@
1−[Para [Span ("an anchor",[],[]) [],Str "Some",Space,Str "text."],Para [Str "A",Space,Str "reference",Space,Str "to",Space,Link ("",[],[]) [Str "Some",Space,Str "text"] ("#an anchor",""),Str "."]]
1+[Para [Span ("an anchor",[],[]) [],Str "Some",Space,Str "text."],Para [Str "A",Space,Str "reference",Space,Str "to",Space,Link ("",[],[]) [Str "Some",Space,Str "text"] ("#an anchor",""),Str "."],Para [Str "Some",Space,Str "text",LineBreak,Str "Another",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "link",Span ("anchor",[],[]) []]]
tests/odt/odt/referenceToText.odt

Binary file not shown.