Repository: sphinx-contrib/spelling (language: python)

Issue:
Add caption nodes to the list of TEXT_NODES
Spotted a misspelling in one of my figure captions *after* fixing everything reported by
``` sh
sphinx-build -M spelling . _build/
```
:sob: 


Discussion / hints:
That looks like it would be a straightforward change. Do you want to propose a patch? Are there other node types being left out?
So straightforward I cannot be bothered to fork and submit a merge request :wink:
`TEXT_ NODES` is in `sphinxcontrib/spelling/builder.py` and adding `'caption'` to that set does the trick for me.
As for other nodes left out I have no idea.  Table captions are converted to `title` nodes.

Fix patch:
diff --git a/docs/source/history.rst b/docs/source/history.rst
index f32248c..0303058 100644
--- a/docs/source/history.rst
+++ b/docs/source/history.rst
@@ -20,6 +20,13 @@ Features
   output. See :doc:`/customize` for more details. Idea contributed by
   Trevor Gross.
 
+Bug Fixes
+---------
+
+- `#36 <https://github.com/sphinx-contrib/spelling/issues/36>`__
+  Include captions of figures in the set of nodes for which the text
+  is checked.
+
 7.4.1
 =====
 
diff --git a/sphinxcontrib/spelling/builder.py b/sphinxcontrib/spelling/builder.py
index 169730c..4020165 100644
--- a/sphinxcontrib/spelling/builder.py
+++ b/sphinxcontrib/spelling/builder.py
@@ -168,6 +168,7 @@ def format_suggestions(self, suggestions):
 
     TEXT_NODES = {
         'block_quote',
+        'caption',
         'paragraph',
         'list_item',
         'term',


Test patch:
diff --git a/tests/test_builder.py b/tests/test_builder.py
index 0c1ce10..8e59d1f 100644
--- a/tests/test_builder.py
+++ b/tests/test_builder.py
@@ -257,3 +257,24 @@ def test_get_suggestions_to_show_disabled(sphinx_project):
     stdout, stderr, app = get_sphinx_app(srcdir, outdir, 'contents')
     results = app.builder.get_suggestions_to_show(['a', 'b', 'c'])
     assert len(results) == 0
+
+
+def test_captions(sphinx_project):
+    srcdir, outdir = sphinx_project
+
+    add_file(srcdir, 'contents.rst', '''
+    The Module
+    ==========
+
+    .. figure:: blah.gif
+
+       Teh caption
+
+    ''')
+
+    stdout, stderr, output_text = get_sphinx_output(
+        srcdir,
+        outdir,
+        'contents',
+    )
+    assert '(Teh)' in output_text