There are many different problems stemming from different approaches to building help files in R, and they all get lumped together under the label "DOI problem." It's hard to say exactly what's causing your issue, and with all due respect, CRAN's automation doesn't necessarily make it any easier to figure out why DOI is a problem. Nevertheless, I'll share what my problem was, as it took me a lot of time to figure it out. Perhaps you or someone else has had the same problem.
Here's what my structure looks like: in my package, all help content comes from a single source: the Markdown files in inst/partials/.md. In the R/.R files, I only have thin roxygen2 "wrappers" with @md and @includeRmd pointing to the appropriate partial (e.g., R/topic-dataset.R pulls in inst/partials/dataset.md). When I run devtools::document(), roxygen2 renders these blocks to man/.Rd, inserting the contents of the partials (that's why .Rd files are artifacts and I don't edit them manually). Vignettes are created separately from vignettes/.Rmd, but they also access the same files in inst/partials via a short chunk that reads the Markdown and outputs it as-is (in my case, it also converts \doi{...} to a clickable HTML link). If I only change partials and roxygen doesn't "catch" the difference, I force a fresh generation by removing man/ and re-running devtools::document(roclets = c("rd","namespace","collate")). This gives me a single source of truth in inst/partials for help topics (?topic) and vignettes, and I maintain CRAN compatibility in Rd with the \doi{...} macro and examples writing only to tempfile()/tempdir().
And now the solutions I had to figure out. Within the raw content in inst\partials\*.rd files, where the DOI was present, it turned out that for the whole thing to work correctly, a double slash was necessary:
by Trzmielewska et al. (2025) \\doi{10.18290/rpsych2024.0019}
and only this allowed me to achieve the desired effect of a correct and clickable DOI R-CRAN link in most helpers. However, the problem remained with HTML files generated using \vignettes\*.Rmd files. Since they only have a pointer to download content from the help file in inst\partials, all I had to do was add one line like this (I'm presenting the entire code, maybe it'll be useful):
---
title: "factorH: dataset"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{factorH: dataset}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, echo=FALSE}
pth <- system.file("partials/dataset.md", package = "factorH")
stopifnot(nzchar(pth))
txt <- readLines(pth, encoding = "UTF-8", warn = FALSE)
# DOI type conversion, THIS IS THE LINE THAT DOES THE WORK:
txt <- gsub("\\\\{1,2}doi\\{\\s*([^}]+)\\s*\\}",
"[DOI: \\1](https://doi.org/\\1)", txt, perl = TRUE)
knitr::asis_output(paste0(paste(txt, collapse = "\n"), "\n\n"))
So, that's all. The rest is building correctly (for now!), and all DOIs are valid clickable elements. I'll probably edit this comment in the future; feel free to ask me about any minor details.