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

Mismatch between shortcode and terminal counts #10

Open
andrewheiss opened this issue Jun 3, 2024 · 0 comments
Open

Mismatch between shortcode and terminal counts #10

andrewheiss opened this issue Jun 3, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@andrewheiss
Copy link
Owner

When using the words-sum shortcode, the number of counted words is slightly off. This is currently mentioned in template.qmd:

An example in this extension is {{{< words-sum ARG >}}}, where ARG is formatted as "ref-note" or "body-append", etc., to count specific sections together. Since words-sum has two words to construct the shortcode but only one word is returned, the region that uses this shortcode is inflated by one.

For instance, with this minimal document:

---
title: "Counts not aligned"
subtitle: "{{< words-sum body >}} words"
format: wordcount-html
---

This sentence has seven words in it.

… the shortcode says that there are 6 words:

image

…while the terminal output reports 7 words:

Overall totals:
----------------------------
- 7 total words
- 7 words in body and notes

Section totals:
----------------------------
- 7 words in text body

It would be nice to adjust the count after using {{< words-sum ARG >}} so that the shortcode output matches the actual count, maybe by counting all the distinct ARGs and adjusting the count accordingly?

@andrewheiss andrewheiss added bug Something isn't working enhancement New feature or request labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant