Assert.That(page.Markdown,Is.EqualTo("first\nsecond\nthird"),"The byte order mark is not part of the text, and the line endings are unified just as they are for an extracted page.");
Assert.That(page.Markdown,Is.EqualTo(" indented: true\n other: false"),"Only blank lines are dropped at the start. The indentation of the first line carries meaning in YAML and in source code.");
Assert.That(page.Title,Is.Empty,"A text document has no title element, and guessing one from the file name would claim something the document does not say.");
Assert.That(page.Description,Is.Empty);
Assert.That(page.Authors,Is.Empty);
Assert.That(page.Language,Is.Empty);
Assert.That(page.CanonicalUrl,Is.Null);
Assert.That(page.Outline,Is.Empty);
});
}
[Test]
publicvoidBinaryContentDeclaredAsTextIsRefused()
{
Assert.Throws<InvalidOperationException>(()=>WebTextContentExtractor.Extract("%PDF-1.7\0\0binary","text/plain",URL),"A server calling a PDF text/plain is common enough, and its bytes decoded as text would reach the model as noise.");
Assert.That(page.Markdown,Is.EqualTo(BODY),"The extractor passes the escape through untouched. Decoding it is the job of the prompt injection filter in the runtime, whose tests in runtime/src/prompt_injection/tests.rs cover this very case; every caller filters the content before a model sees it.");