Skip to content

Commit 21d9c39

Browse files
committed
don't identify [..., @foo-bar] as cross reference, which should be citation instead
1 parent adae910 commit 21d9c39

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: litedown
22
Type: Package
33
Title: A Lightweight Version of R Markdown
4-
Version: 0.1.1
4+
Version: 0.1.2
55
Authors@R: c(
66
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
77
person()

R/mark.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mark = function(input, output = NULL, text = NULL, options = NULL, meta = list()
197197
# turn @ref into [@ref](#ref) and resolve cross-references later in JS; for
198198
# latex output, turn @ref to \ref{}
199199
r_ref = '([a-z]+)-([-_[:alnum:]]+)' # must start with letters followed by -
200-
r5 = paste0('(^|(?<=\\s|\\())@', r_ref)
200+
r5 = paste0('(^|(?<=\\s|\\())@', r_ref, '(?!\\])')
201201
if (test_feature('cross_refs', r5)) {
202202
text[p] = match_replace(text[p], r5, function(x) {
203203
sprintf('[%s](%s)', x, sub('^@', '#', x))

0 commit comments

Comments
 (0)