diff --git a/R/translate.R b/R/translate.R index 95251c1..2813a22 100644 --- a/R/translate.R +++ b/R/translate.R @@ -167,7 +167,7 @@ translate_part <- function(xml, glossary_id, source_lang, target_lang, formality ## protect content inside square brackets ---- contain_square_brackets <- xml2::xml_find_all( woolish$body, - '//*[contains(text(), "[") and contains(text(), "[")]' + '//*[contains(text(), "[") and contains(text(), "]")]' ) if (length(contain_square_brackets) > 0) { purrr::walk(contain_square_brackets, protect_squaries)