Assert.That(FileExportFormat.MICROSOFT_WORD.FollowsPageAnchors(),Is.False,"Word looks for a file whose name ends in the fragment, finds none, and refuses the link.");
Assert.That(FileExportFormat.OPEN_DOCUMENT_TEXT.FollowsPageAnchors(),Is.False,"LibreOffice does the same, verified on 2026-09-15 with an exported .odt.");
Assert.That(FileExportFormat.HTML.FollowsPageAnchors(),Is.True,"A browser opens the document on the page the fragment names.");
}),"A format was added to or removed from the export menu: say in FollowsPageAnchors whether its reader follows a page in a local link, then name it here.");
[TestCase("Q3: Umsatz/Planung?", FileExportFormat.HTML, "Q3 Umsatz Planung.html", Description = "A chat is named after the first words of its question, and those may hold anything.")]
[TestCase("Notes for the meeting.", FileExportFormat.MARKDOWN, "Notes for the meeting.md", Description = "Windows drops a trailing dot anyway.")]
Assert.That(FileExportFormat.HTML.IsPlainText(),Is.True,"A page the model wrote is a finished file, even though an entire answer needs Pandoc to become one.");
varfound=format.TryToComment("A page titled --> Start, and one titled --!> Next",outvarcomment);
Assert.Multiple(()=>
{
Assert.That(found,Is.True);
Assert.That(comment,Does.StartWith("<!--"));
Assert.That(comment.IndexOf("-->",StringComparison.Ordinal),Is.EqualTo(comment.Length-3),"Only the end of the comment may end it; the title would spill onto the page otherwise.");
Assert.That(comment,Does.Not.Contain("--!>"),"A browser ends a comment there as well.");
Assert.That(comment,Does.Contain("Start").And.Contain("Next"),"The title stays readable.");
Assert.That(comment,Does.Contain("https://xn--mnchen-3ya.de/"),"A domain with an umlaut is written with two dashes, and the link has to keep working.");
}
[Test]
publicvoidEveryLineOfALatexCommentIsOne()
{
varfound=FileExportFormat.LATEX.TryToComment(Lines("# Sources",string.Empty,"- [1] A title with 100 % and a_b"),outvarcomment);
Assert.Multiple(()=>
{
Assert.That(found,Is.True);
Assert.That(comment.Split(Environment.NewLine),Is.EqualTo(new[]{"% # Sources","%","% - [1] A title with 100 % and a_b"}),"LaTeX has no end of a comment, only the end of a line.");