Issue 3143: Don't duplicate text for anchors

When creating an anchor element we were adding its representation
as well as the original content, leading to text duplication.
This commit is contained in:
Hubert Plociniczak 2016-10-18 10:50:37 +02:00
parent cbeb72d06b
commit c74c5fdd97
3 changed files with 3 additions and 4 deletions

View file

@ -713,9 +713,8 @@ maybeAddAnchorFrom anchorReader =
>>> >>>
proc (inlines, fAnchorElem) -> do proc (inlines, fAnchorElem) -> do
case fAnchorElem of case fAnchorElem of
Right anchorElem -> Right anchorElem -> returnA -< anchorElem
arr (anchorElem <>) -<< inlines Left _ -> returnA -< inlines
Left _ -> returnA -< inlines
where where
toAnchorElem :: Anchor -> Inlines toAnchorElem :: Anchor -> Inlines
toAnchorElem anchorID = spanWith (anchorID, [], []) mempty toAnchorElem anchorID = spanWith (anchorID, [], []) mempty

View file

@ -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 "."]] [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",[],[]) []]]

Binary file not shown.