Skip to content

Commit

Permalink
Test and fix for #219
Browse files Browse the repository at this point in the history
  • Loading branch information
lierdakil committed Feb 15, 2019
1 parent 97e701d commit cb12fdf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Text/Pandoc/CrossRef/References/Refs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ allCitsPrefix :: Options -> [Citation] -> Maybe String
allCitsPrefix opts cits = find isCitationPrefix $ prefixList opts
where
isCitationPrefix p =
all (p `isPrefixOf`) $ map (uncapitalizeFirst . citationId) cits
all (p ==) $ map (takeWhile (/=':') . uncapitalizeFirst . citationId) cits

replaceRefsLatex :: String -> Options -> [Citation] -> WS Inlines
replaceRefsLatex prefix opts cits
Expand Down
5 changes: 4 additions & 1 deletion pandoc-crossref.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 7e8ea8006377ab15599e5d75415f742a04fb38a7e792859fd80eabb3c4b043cf
-- hash: b019c9e3e9e85522e4f62ec3b1985acbc6773ca9d58bc8568ecc2f4c2eb93e9e

name: pandoc-crossref
version: 0.4.0.0
Expand Down Expand Up @@ -52,6 +52,9 @@ data-files:
test/m2m/listing-captions-ids/expect.md
test/m2m/listing-captions-ids/expect.tex
test/m2m/listing-captions-ids/input.md
test/m2m/regresssion-219/expect.md
test/m2m/regresssion-219/expect.tex
test/m2m/regresssion-219/input.md
test/m2m/section-template/expect.md
test/m2m/section-template/expect.tex
test/m2m/section-template/input.md
Expand Down
2 changes: 2 additions & 0 deletions test/m2m/regresssion-219/expect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A citation starting with "fig", like @Figueroa2012-tu should not be
interpreted as a reference.
2 changes: 2 additions & 0 deletions test/m2m/regresssion-219/expect.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A citation starting with ``fig'', like {[}@Figueroa2012-tu{]} should not
be interpreted as a reference.
2 changes: 2 additions & 0 deletions test/m2m/regresssion-219/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A citation starting with "fig", like @Figueroa2012-tu should not be
interpreted as a reference.

0 comments on commit cb12fdf

Please sign in to comment.