@@ -317,6 +317,7 @@ rawLines = do
317317
318318noteBlock :: MarkdownParser (F Blocks)
319319noteBlock = try $ do
320+ pos <- getPosition
320321 skipNonindentSpaces
321322 ref <- noteMarker
322323 char ':'
@@ -328,7 +329,11 @@ noteBlock = try $ do
328329 optional blanklines
329330 parsed <- parseFromString parseBlocks raw
330331 let newnote = (ref, parsed)
331− updateState $ \s -> s { stateNotes' = newnote : stateNotes' s }
332+ oldnotes <- stateNotes' <$> getState
333+ case lookup ref oldnotes of
334+ Just _ -> addWarning (Just pos) $ "Duplicate note reference `" ++ ref ++ "'"
335+ Nothing -> return ()
336+ updateState $ \s -> s { stateNotes' = newnote : oldnotes }
332337 return mempty
333338
334339--