dotnet / dotnet/extensions

MarkItDownReader raises exception when it encounters AutolinkInLine (in .doc files) - Unsupported.

Open
#7,672 0 comments 0 reactions 0 assignees View on GitHub
bug untriaged
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

### Description

When executing this against a document with a specific hyperlink:
var reader = new MarkItDownReader(MarkItDownExeFi, false);
doc = await reader.ReadAsync(fi);
result.Success = true;
I encounter an exception : {"Inline type 'AutolinkInline' is not supported."}
Data: Count = 0
HResult: -2146233067
HelpLink: null
InnerException: null
Message: "Inline type 'AutolinkInline' is not supported."
Source: "Microsoft.Extensions.DataIngestion.MarkItDown"
StackTrace: " at Microsoft.Extensions.DataIngestion.MarkdownParser.GetText(ContainerInline containerInline)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.MapLeafBlockToElement(LeafBlock block, Boolean previousWasBreak, String elementMarkdown)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.MapBlock(String documentMarkdown, Boolean previousWasBreak, Block block)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.GetCells(Table table, String outputContent)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.MapBlock(String documentMarkdown, Boolean previousWasBreak, Block block)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.Map(MarkdownDocument markdownDocument, String documentMarkdown, String identifier)\r\n at Microsoft.Extensions.DataIngestion.MarkdownParser.Parse(String markdown, String identifier)\r\n at Microsoft.Extensions.DataIngestion.MarkItDownReader.d__3.MoveNext()\r\n at FileScraper.DocumentExtractor.d__0.MoveNex
t() in E:\\NetCore\\FileScraper\\Others\\MyTextExtraction.cs:line 74"

### Reproduction Steps

Execute this (in c#, net core )executing this against a document with a specific hyperlink:
var reader = new Mar

[Women in Art from Middle-Ages.docx](https://github.com/user-attachments/files/30632252/Women.in.Art.from.Middle-Ages.docx)

kItDownReader(MarkItDownExeFi, false);
doc = await reader.ReadAsync(fi);

### Expected behavior

I expect that the MarkItDown processes it gracefully, even if only treating as a string or ignoring it.

### Actual behavior

Causes Exception and does not read the rest of the file.

### Regression?

For the purpose of this report, I went back and tried it also on 10.0.0-preview.1.25559.3
My current version is 10.0.0-preview.1.26364.2

### Known Workarounds

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at MarkItDownReader.ReadAsync and follow the MarkdownParser stack trace while reproducing the issue with the attached Women in Art from Middle-Ages.docx file. Verify that the AutolinkInline encountered in the converted Markdown is handled without an exception and that the remainder of the document is read.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.