tagQuery does not allow ":" to exist in tag type when searching
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start at R/selector.R line 44 and reproduce the reported x_q$find("w:t") failure from the issue body. Trace how tagQuery handles the colon, then verify that namespaced tags such as w:t can be searched while the existing selector behavior remains intact.
Written by the indexing model from the issue text.
Description
I am working on some ooxml to support processing of {gt} into word outputs and I was hoping to use tagQuery to allow me to sort through the tags and make edits. tag types are prepended for docx outputs with w:. The current logic blocks me from using : anywhere in a tag because it does a simple search for : existing. Could there be a caveat in this if statement to check whether that call matches directly any tag types or something?
https://github.com/rstudio/htmltools/blob/39b3f1f6a4abef8acebc407d506d239d871d6a03/R/selector.R#L44
ie given the ooxml: <w:p><w:pPr></w:pPr><w:r><w:rPr></w:rPr><w:t xml:space="default">Test this</w:t></w:r></w:p>
if I want to access the text tag (w:t), the find (or any other cssSelector arg) complains about ::
library(htmltools)
## contructed html tag of ooxml containing a paragraph saying "test string"
x <- structure(list(name = "w:p", attribs = list(), children = list(
structure("<w:pPr></w:pPr><w:r><w:rPr></w:rPr><w:t xml:space=\"default\">test string</w:t></w:r>", html = TRUE, class = c("html",
"character")))), class = "shiny.tag")
x_q <- tagQuery(x)
x_q$find("w:t")
- Dominant language
- R
- Stars
- 225
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/htmltools
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Consider removing empty `.shiny-html-output` containers from document flow in fillable containers Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in rstudio/htmltools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·