benmarwick / wordcountaddin

Word counts and readability statistics in R markdown documents
Other
337 stars 33 forks source link

fixed YAML detection and exclusion #38

Closed mattwarkentin closed 4 years ago

mattwarkentin commented 4 years ago

The solution for fixing the YAML issue is a little more brute force than I thought it would need to be, but I think it should work well. It basically enforces a check to ensure the first "---" pattern detected is the opening line in the file (i.e. there is indeed a YAML front matter), the next "---" pattern is used to enclose the YAML (yaml_end), and the entire YAML block is removed.

The existing units tests cover the updated code; I just needed to update the test expectations.

mattwarkentin commented 4 years ago

I didn't add myself as a contributor to the DESCRIPTION file, because I didn't know if this was enough of a contribution to warrant my inclusion. But I can add my name if you disagree. Thanks for creating this package.

benmarwick commented 4 years ago

Thank you very much, your work here is definitely enough for you to qualify to be named as a contributor to the DESCRIPTION file. If you'd like to update this PR with an edit to the DESCRIPTION, I'd be happy to merge this. Thanks again!

mattwarkentin commented 4 years ago

Added my name to the DESCRIPTION file! Thanks.

benmarwick commented 4 years ago

Thanks for your contribution, I really appreciate that!