git.iko.soy/typeable/pandoc
on master help sign in
Issue 3143: Don't duplicate text for anchors
c74c5fdHubert Plociniczak
src/Text/Pandoc/Readers/Odt/ContentReader.hs+2−3
@@ -713,9 +713,8 @@ maybeAddAnchorFrom anchorReader =
713 >>>
713 >>>
714 proc (inlines, fAnchorElem) -> do
714 proc (inlines, fAnchorElem) -> do
715 case fAnchorElem of
715 case fAnchorElem of
716− Right anchorElem ->
716+ Right anchorElem -> returnA -< anchorElem
717− arr (anchorElem <>) -<< inlines
718− Left _ -> returnA -< inlines
717+ Left _ -> returnA -< inlines
719 where
718 where
720 toAnchorElem :: Anchor -> Inlines
719 toAnchorElem :: Anchor -> Inlines
721 toAnchorElem anchorID = spanWith (anchorID, [], []) mempty
720 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.