The following changes to translate.R fix some issues I've been having with inline latex in confluence:
# Include this after line 64:
# Mark $ and $$ in plain <li> so that we can replace them safely later.
list_item_nodes <- xml2::xml_find_all(html_doc, "//li/text()")
for (node in list_item_nodes) {
text <- xml2::xml_text(node)
text <- mark_math(text)
text <- mark_inline_math(text)
xml2::xml_text(node) <- text
}
Change the regex in mark_inline_math to:
x <- stringi::stri_replace_all_regex(x, "(?<=[^\\s\\\\])\\$($|(?=[\\s:.,]))", "%1%D%O%L%L%A%R%", multiline = TRUE)
The following changes to translate.R fix some issues I've been having with inline latex in confluence:
Change the regex in mark_inline_math to: