Skip to content

Commit

Permalink
Support list of wordlists as a string
Browse files Browse the repository at this point in the history
Allow a wordlist filename string to contain a list of wordlist filenames
  • Loading branch information
grhm authored and dhellmann committed May 30, 2022
1 parent 0413a27 commit cf093b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sphinxcontrib/spelling/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def get_wordlist_filename(self):
if word_list is None:
word_list = 'spelling_wordlist.txt'

if (isinstance(word_list, str) and
word_list.startswith('[') and
word_list.endswith(']')):
# Wordlist is a list, formatted as a str.
# Split it back into a list
word_list = word_list[1:-1].split(',')

if not isinstance(word_list, list):
return os.path.join(self.srcdir, word_list)

Expand Down

0 comments on commit cf093b8

Please sign in to comment.