Skip to content

Commit

Permalink
Fix bullet character on Windows
Browse files Browse the repository at this point in the history
Windows doesn't support os.getenv("LANG"), so it was causing an error
  • Loading branch information
andrewheiss committed Jun 3, 2024
1 parent e1a1151 commit 5c89b94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _extensions/wordcount/_extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
- name: Justin Landis
orcid: 0000-0001-5501-4934
version: 1.3.0
quarto-required: ">=1.3.0"
quarto-required: ">=1.4.551"
contributes:
shortcodes:
- "words.lua"
Expand Down
3 changes: 2 additions & 1 deletion _extensions/wordcount/wordcount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ function print_word_counts()
local manuscript_words = body_words + note_words

-- Use a bullet character in terminals that support UTF-8
local bullet = os.getenv("LANG"):find("UTF%-8$") and "" or "* "
local bullet = (os.getenv("OS"):find("^Windows") or
os.getenv("LANG"):find("UTF%-8$")) and "" or "* "

-- Format these different numbers
local total_words_out = string.format(
Expand Down

0 comments on commit 5c89b94

Please sign in to comment.