Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ private static IngestionDocumentSection MapQuoteBlock(QuoteBlock quoteBlock, boo
{
content.Append(codeInline.Content);
}
else if (inline is HtmlInline htmlInline)
{
content.Append(htmlInline.Tag);
}
else
{
throw new NotSupportedException($"Inline type '{inline.GetType().Name}' is not supported.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,32 @@ public async Task SupportsTablesWithImages()
Assert.Equal("Latest logo", img.AlternativeText);
}

[ConditionalFact]
public async Task SupportsInlineHtml()
{
string markdownContent = "This has <sup>[1]</sup> inline HTML.";

IngestionDocument document = await ReadAsync(markdownContent);

var paragraph = Assert.Single(document.EnumerateContent().OfType<IngestionDocumentParagraph>());
Assert.Equal("This has <sup>[1]</sup> inline HTML.", paragraph.Text);
Assert.Equal(markdownContent, paragraph.GetMarkdown());
}

[ConditionalFact]
public async Task SupportsMultipleInlineHtmlElements()
{
string markdownContent = """
Text with <strong>bold</strong>, <em>italic</em>, <sub>subscript</sub>, and <sup>superscript</sup> tags.
""";

IngestionDocument document = await ReadAsync(markdownContent);

var paragraph = Assert.Single(document.EnumerateContent().OfType<IngestionDocumentParagraph>());
Assert.Equal("Text with <strong>bold</strong>, <em>italic</em>, <sub>subscript</sub>, and <sup>superscript</sup> tags.", paragraph.Text);
Assert.Equal(markdownContent, paragraph.GetMarkdown());
}

private async Task<IngestionDocument> ReadAsync(string content)
{
using MemoryStream stream = new(System.Text.Encoding.UTF8.GetBytes(content));
Expand Down
Loading