Add home hero with intro and buttons from the body, next-event card and page tiles
This commit is contained in:
1 parent
b737f57ef7
commit
e51afeb34b
23 files changed
+1262
-65
No files matched your search
@@ -78,4 +78,49 @@ public class MarkdownTests
|
||||
html.ShouldContain($"<li class=\"{Markdown.LoneLinkClass}\"><a href=\"/dokumente/antrag.pdf\">");
|
||||
html.ShouldContain("<li>Text mit");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void First_sentence_skips_the_heading_and_drops_the_markdown()
|
||||
{
|
||||
var sentence = Markdown.FirstSentence(
|
||||
"# Vorstand\n\nWir sind **sieben** [Eltern](/board). Der Rest folgt.");
|
||||
|
||||
sentence.ShouldBe("Wir sind sieben Eltern.");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Wir helfen z. B. bei Anträgen. Mehr dazu unten.", "Wir helfen z. B. bei Anträgen.")]
|
||||
[InlineData("Gewählt am 13. November 2025. Danach mehr.", "Gewählt am 13. November 2025.")]
|
||||
[InlineData("Haben Sie Fragen? Schreiben Sie uns.", "Haben Sie Fragen?")]
|
||||
[InlineData("Ohne Satzzeichen am Ende", "Ohne Satzzeichen am Ende")]
|
||||
public void First_sentence_ends_at_a_real_sentence_end(string markdown, string expected) =>
|
||||
Markdown.FirstSentence(markdown).ShouldBe(expected);
|
||||
|
||||
[Fact]
|
||||
public void First_sentence_joins_soft_line_breaks_with_a_space()
|
||||
{
|
||||
// Editors wrap long lines; the wrap must not glue two words together.
|
||||
Markdown.FirstSentence("Erste Zeile\nzweite Zeile.").ShouldBe("Erste Zeile zweite Zeile.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void First_sentence_longer_than_the_limit_is_cut_between_words()
|
||||
{
|
||||
var sentence = Markdown.FirstSentence("Eins zwei drei vier fünf.", maxLength: 12);
|
||||
|
||||
sentence.ShouldBe("Eins zwei…");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
[InlineData("# Nur eine Überschrift")]
|
||||
[InlineData("- nur\n- eine Liste")]
|
||||
[InlineData("::: hinweis\nText im Baustein.\n:::")]
|
||||
public void First_sentence_is_empty_without_a_top_level_paragraph(string? markdown) =>
|
||||
Markdown.FirstSentence(markdown).ShouldBe("");
|
||||
|
||||
[Fact]
|
||||
public void First_sentence_rejects_a_limit_below_one() =>
|
||||
Should.Throw<ArgumentOutOfRangeException>(() => Markdown.FirstSentence("Text.", maxLength: 0));
|
||||
}
|
||||
Reference in new issue
Block a user