Skip to content

Commit

Permalink
don't identify [..., @foo-bar] as cross reference, which should be …
Browse files Browse the repository at this point in the history
…citation instead
  • Loading branch information
yihui committed Aug 23, 2024
1 parent adae910 commit 21d9c39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: litedown
Type: Package
Title: A Lightweight Version of R Markdown
Version: 0.1.1
Version: 0.1.2
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person()
Expand Down
2 changes: 1 addition & 1 deletion R/mark.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ mark = function(input, output = NULL, text = NULL, options = NULL, meta = list()
# turn @ref into [@ref](#ref) and resolve cross-references later in JS; for
# latex output, turn @ref to \ref{}
r_ref = '([a-z]+)-([-_[:alnum:]]+)' # must start with letters followed by -
r5 = paste0('(^|(?<=\\s|\\())@', r_ref)
r5 = paste0('(^|(?<=\\s|\\())@', r_ref, '(?!\\])')
if (test_feature('cross_refs', r5)) {
text[p] = match_replace(text[p], r5, function(x) {
sprintf('[%s](%s)', x, sub('^@', '#', x))
Expand Down

0 comments on commit 21d9c39

Please sign in to comment.