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

Can't identify "categories" on Windows because of newline characters #5

Open
christian-million opened this issue Jan 22, 2024 · 1 comment

Comments

@christian-million
Copy link

I am running R/RStudio on a Windows 11 machine and received the following error:

> quartopost::quartopost()
Error in if (stringr::str_detect(f_list[[i]], "categories:")) { : 
  missing value where TRUE/FALSE needed

I was able to trace the error back to the get_cat function in R\utils.R. Specifically, Line #139.

On Windows, when I hit [ENTER] to create a new line, it uses \r\n to create a new line, instead of \n. Googling around indicates this is common for windows machines.

The regex in Line #139 is looking for the YAML section to end with ---\n, but in my case the YAML ended with ---\r\n.

I downloaded your source repository, made the addition to the regex to include ---\\r\\n, installed the updated source package, and was able to successfully use your package.

Since I have this work-around, I don't need this issue resolved, but I thought open this issue for others and so you can consider a regex expression that is more flexible.

Excellent package as I wait for this quarto-r enhancement to be added :) Thank you!

@petzi53
Copy link
Owner

petzi53 commented Feb 1, 2024

Thank you for bringing this issue to my attention. I am working on macOS, so I couldn't test it on a window machine. I will resolve the issue with the next release of quartopost. But this could take a while as I am currently busy on other projects.

Afterthought: I have the impression that the Quarto developers are planning to add your desired functionality into future releases. It seems to me generally that a function for new blog entries would be a very useful feature for many Quarto blog users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants