Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] [0.16.0] callout block titles with markup have duplicated text #556

Closed
zkamvar opened this issue Dec 14, 2023 · 0 comments · Fixed by #557
Closed

[bug] [0.16.0] callout block titles with markup have duplicated text #556

zkamvar opened this issue Dec 14, 2023 · 0 comments · Fixed by #557
Assignees
Labels
bug Something isn't working

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Dec 14, 2023

The callout blocks with markup in their titles have duplicated text:

For example, the title ### callout (`callout`) appears like this:

callout with the title of callout (callout)callout)

The source of the error is from

sandpaper/R/utils-xml.R

Lines 198 to 201 in 50bfd5a

callouts <- xml2::xml_find_all(nodes, ".//div[starts-with(@class, 'callout ')]")
h3 <- xml2::xml_find_all(callouts, "./div/h3")
translations <- get_callout_translations()
xml_text_translate(h3, translations)

What we need to do is to select /text() before we pass the elements to xml_text_translate()

@zkamvar zkamvar added the bug Something isn't working label Dec 14, 2023
@zkamvar zkamvar self-assigned this Dec 14, 2023
zkamvar added a commit that referenced this issue Dec 14, 2023
zkamvar added a commit that referenced this issue Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant