From 5c89b9440ba407940060253078ca7f92d7cda699 Mon Sep 17 00:00:00 2001 From: Andrew Heiss Date: Mon, 3 Jun 2024 08:02:50 -0400 Subject: [PATCH] Fix bullet character on Windows Windows doesn't support os.getenv("LANG"), so it was causing an error --- _extensions/wordcount/_extension.yml | 2 +- _extensions/wordcount/wordcount.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_extensions/wordcount/_extension.yml b/_extensions/wordcount/_extension.yml index a987279..1f0c821 100644 --- a/_extensions/wordcount/_extension.yml +++ b/_extensions/wordcount/_extension.yml @@ -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" diff --git a/_extensions/wordcount/wordcount.lua b/_extensions/wordcount/wordcount.lua index 8b228d9..af503d4 100644 --- a/_extensions/wordcount/wordcount.lua +++ b/_extensions/wordcount/wordcount.lua @@ -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(