Skip to content

Commit

Permalink
Ignore pandoc 'heading identifiers' in markdown text (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored and jeroen committed May 27, 2019
1 parent 823e506 commit 569a24f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/parse-markdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ parse_text_md <- function(path, extensions = TRUE, yaml_fields = c("title" ,"sub
paste0(collapse = "\n", xml2::xml_text(xml2::xml_find_all(x, "./text")))
}, character(1))

# Strip 'heading identifiers', see: https://pandoc.org/MANUAL.html#heading-identifiers
values <- gsub('\\{#[^\\n]+\\}\\s*($|\\r?\\n)', '\\1', values, perl = TRUE)

data.frame(
text = values,
position = sourcepos,
Expand Down

0 comments on commit 569a24f

Please sign in to comment.