Doc Extractor and word_extractor fails to extract content from nested tables in DOCX files #16704

Closed
opened 2026-02-21 19:27:15 -05:00 by yindo · 6 comments
Owner

Originally created by @shamspias on GitHub (Sep 3, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.8.0,1.8.1

Cloud or Self Hosted

Self Hosted (Source), Self Hosted (Docker)

Steps to reproduce

  1. Create a workflow using the Doc Extractor plugin (default settings).

  2. Upload the attached sample file: SampleDocx_YesonWyld_20250902.docx

    • The document contains a table where one cell includes a sub-table (nested table).
  3. Run the extraction.

in Knowledge

  1. Create Knowledge
  2. Upload the attached sample file
  3. Next and then check preview Chunk

✔️ Expected Behavior

  • Text inside all tables including any tables nested inside other tables should be extracted.
  • Nested tables can be flattened to markdown or returned as structured JSON, but their cell contents should not be lost.

example based on the doc file I give

Heading1
Start: The quick brown fox jumps over the lazy dog.

Table
No | Name | Description
1  | fox  | brown
2  | dog  | lazy

End
End: The quick brown fox jumps over the lazy dog.

Actual Behavior

  • Only the outer table is detected; the contents of the inner (nested) table are missing from the output.

  • No errors appear in the logs.

Example Based on the File I give:

Heading1
Start: The quick brown fox jumps over the lazy dog.

Table

End
End: The quick brown fox jumps over the lazy dog.

Originally created by @shamspias on GitHub (Sep 3, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.8.0,1.8.1 ### Cloud or Self Hosted Self Hosted (Source), Self Hosted (Docker) ### Steps to reproduce 1. Create a workflow using the **Doc Extractor** plugin (default settings). 2. Upload the attached sample file: [SampleDocx_YesonWyld_20250902.docx](https://github.com/user-attachments/files/22118629/SampleDocx_YesonWyld_20250902.docx) * The document contains a table where one cell includes a **sub-table** (nested table). 3. Run the extraction. in Knowledge 1. Create Knowledge 2. Upload the attached sample file 3. Next and then check `preview Chunk` ### ✔️ Expected Behavior * Text inside **all** tables including any tables nested inside other tables should be extracted. * Nested tables can be flattened to markdown or returned as structured JSON, but their cell contents should **not** be lost. example based on the doc file I give ``` Heading1 Start: The quick brown fox jumps over the lazy dog. Table No | Name | Description 1 | fox | brown 2 | dog | lazy End End: The quick brown fox jumps over the lazy dog. ``` ### ❌ Actual Behavior - Only the outer table is detected; the contents of the inner (nested) table are missing from the output. - No errors appear in the logs. Example Based on the File I give: ``` Heading1 Start: The quick brown fox jumps over the lazy dog. Table End End: The quick brown fox jumps over the lazy dog. ```
yindo added the 🐞 bug label 2026-02-21 19:27:15 -05:00
yindo closed this issue 2026-02-21 19:27:15 -05:00
Author
Owner

@shamspias commented on GitHub (Sep 3, 2025):

I found a similar case in langgenius/dify-official-plugins#1633 and used the sample DOCX file from there to reproduce the problem. The extractor still fails to read nested table contents it only outputs "Table" instead of the actual cell text.

@shamspias commented on GitHub (Sep 3, 2025): I found a similar case in langgenius/dify-official-plugins#1633 and used the sample DOCX file from there to reproduce the problem. The extractor still fails to read nested table contents it only outputs "Table" instead of the actual cell text.
Author
Owner

@dosubot[bot] commented on GitHub (Sep 3, 2025):

This is a confirmed, open issue tracked in dify-official-plugins#1633: the Doc Extractor plugin currently does not extract content from nested tables in DOCX files, only outputting "Table" instead of the actual cell text. There are no error logs, no documented workaround, and no recent code changes or merged pull requests addressing this limitation. The plugin's codebase does not contain any implementation or TODOs for nested table extraction, so this feature is not yet supported or actively being developed in the official plugins repo.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 3, 2025): <!-- Answer --> This is a confirmed, open issue tracked in [dify-official-plugins#1633](https://github.com/langgenius/dify-official-plugins/issues/1633): the Doc Extractor plugin currently does not extract content from nested tables in DOCX files, only outputting "Table" instead of the actual cell text. There are no error logs, no documented workaround, and no recent code changes or merged pull requests addressing this limitation. The plugin's codebase does not contain any implementation or TODOs for nested table extraction, so this feature is not yet supported or actively being developed in the official plugins repo. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/25095)
Author
Owner

@shamspias commented on GitHub (Sep 3, 2025):

This is a confirmed, open issue tracked in dify-official-plugins#1633: the Doc Extractor plugin currently does not extract content from nested tables in DOCX files, only outputting "Table" instead of the actual cell text. There are no error logs, no documented workaround, and no recent code changes or merged pull requests addressing this limitation. The plugin's codebase does not contain any implementation or TODOs for nested table extraction, so this feature is not yet supported or actively being developed in the official plugins repo.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

The issue is in WordExtractor: _parse_cell only handles paragraphs and ignores nested tables, causing missing content. It needs to also process tbl elements recursively (via _table_to_markdown) to properly extract nested tables. This is a core Dify bug, not a plugin issue. File: api/core/rag/extractor/word_extractor.py. please correct me if I am wrong.

@shamspias commented on GitHub (Sep 3, 2025): > This is a confirmed, open issue tracked in [dify-official-plugins#1633](https://github.com/langgenius/dify-official-plugins/issues/1633): the Doc Extractor plugin currently does not extract content from nested tables in DOCX files, only outputting "Table" instead of the actual cell text. There are no error logs, no documented workaround, and no recent code changes or merged pull requests addressing this limitation. The plugin's codebase does not contain any implementation or TODOs for nested table extraction, so this feature is not yet supported or actively being developed in the official plugins repo. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8bd11388-529a-492d-856a-80ebda2ae931?feedback_type=other)  [![Chat with Dosu](https://camo.githubusercontent.com/d9ffebb979729c9ef0fc4e3090dbae5b17cabbfec8afe378ada6b81913d6ad8a/68747470733a2f2f646f73752e6465762f646f73752d636861742d62616467652e737667)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github) [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/25095) The issue is in **WordExtractor**: `_parse_cell` only handles paragraphs and ignores nested tables, causing missing content. It needs to also process `tbl` elements recursively (via `_table_to_markdown`) to properly extract nested tables. This is a **core Dify bug**, not a plugin issue. File: `api/core/rag/extractor/word_extractor.py`. please correct me if I am wrong.
Author
Owner

@dosubot[bot] commented on GitHub (Sep 3, 2025):

You are correct: the bug is in the core Dify WordExtractor, not just the plugin. The _parse_cell method in api/core/rag/extractor/word_extractor.py only processes paragraphs and ignores nested tables (tbl elements), so any content inside nested tables is lost during extraction. There is no recursive logic or workaround in the current codebase, and recent pull requests only made minor cleanups without addressing this issue. Fixing it would require updating _parse_cell to detect and recursively process nested tables, likely by calling _table_to_markdown when a tbl element is found inside a cell. Reference

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Sep 3, 2025): <!-- Answer --> You are correct: the bug is in the core Dify WordExtractor, not just the plugin. The `_parse_cell` method in `api/core/rag/extractor/word_extractor.py` only processes paragraphs and ignores nested tables (`tbl` elements), so any content inside nested tables is lost during extraction. There is no recursive logic or workaround in the current codebase, and recent pull requests only made minor cleanups without addressing this issue. Fixing it would require updating `_parse_cell` to detect and recursively process nested tables, likely by calling `_table_to_markdown` when a `tbl` element is found inside a cell. [Reference](https://github.com/langgenius/dify/blob/c7700ac1762a4feccf60211d3dca3e39ec65a83c/api/core/rag/extractor/word_extractor.py) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/af667e2f-6f9f-4e6d-9ac5-ddec2ec1baec?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/25095)
Author
Owner

@crazywoola commented on GitHub (Sep 3, 2025):

We will release RAG 2.0 later, in that version you can choose your own extractor, if you can not find one, you can build a plugin as well.

@crazywoola commented on GitHub (Sep 3, 2025): We will release RAG 2.0 later, in that version you can choose your own extractor, if you can not find one, you can build a plugin as well.
Author
Owner

@YesonWyld commented on GitHub (Sep 3, 2025):

We will release RAG 2.0 later, in that version you can choose your own extractor, if you can not find one, you can build a plugin as well.

Looking forward to it.

@YesonWyld commented on GitHub (Sep 3, 2025): > We will release RAG 2.0 later, in that version you can choose your own extractor, if you can not find one, you can build a plugin as well. Looking forward to it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16704