Fix six failing tests
- SheetMonth takes the short months from a fixed list instead of the host's ICU data, which abbreviates March as "Mär." in newer CLDR versions - FirstSentence treats only one- or two-digit numbers as ordinals, so a year such as "2025." ends the sentence - Route smoke tests allow the scoped-CSS attribute after href and decode entities before matching umlauts and dashes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
55cd201429
commit
be1ea4452f
3 files changed
+31
-12
No files matched your search
@@ -34,6 +34,15 @@ public static class EventDateFormat
|
||||
/// </summary>
|
||||
private const string DayMonth = "d. MMMM";
|
||||
|
||||
/// <summary>
|
||||
/// The short months for the calendar sheet, January first, without periods.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fixed here so they do not depend on the host's ICU version; see <see cref="SheetMonth"/>.
|
||||
/// </remarks>
|
||||
private static readonly string[] SheetMonths =
|
||||
["Jan", "Feb", "März", "Apr", "Mai", "Juni", "Juli", "Aug", "Sept", "Okt", "Nov", "Dez"];
|
||||
|
||||
/// <summary>
|
||||
/// Formats the date range of an event.
|
||||
/// </summary>
|
||||
@@ -76,10 +85,16 @@ public static class EventDateFormat
|
||||
/// <remarks>
|
||||
/// Returned in normal case; the sheet's CSS sets it in capitals. The period of the
|
||||
/// abbreviation (<c>Okt.</c>) is dropped because on a sheet it reads as a stray dot.
|
||||
/// <para>
|
||||
/// Taken from <see cref="SheetMonths"/>, not from the culture's <c>MMM</c>
|
||||
/// format: that comes from the ICU data of the host, and newer CLDR versions
|
||||
/// abbreviate March as <c>Mär.</c> instead of <c>März</c>, so the sheet
|
||||
/// would change with the base image.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <seealso cref="CalendarSheet"/>
|
||||
public static string SheetMonth(DateTime value)
|
||||
=> value.ToString("MMM", Cultures.German).TrimEnd('.');
|
||||
=> SheetMonths[value.Month - 1];
|
||||
|
||||
/// <summary>
|
||||
/// The day of the month for the large number on a calendar sheet.
|
||||
|
||||
@@ -108,8 +108,9 @@ public static partial class Markdown
|
||||
/// a list or a <c>:::</c> block is rarely a sentence that describes the page.
|
||||
/// <para>
|
||||
/// A sentence ends at <c>.</c>, <c>!</c> or <c>?</c> followed by a space or
|
||||
/// the end. A period after a single letter or a number does not count, so
|
||||
/// <c>z. B.</c> and <c>13. November</c> do not cut the sentence short. A
|
||||
/// the end. A period after a single letter or a number of one or two digits
|
||||
/// does not count, so <c>z. B.</c> and <c>13. November</c> do not cut the
|
||||
/// sentence short, while a year such as <c>2025.</c> still ends it. A
|
||||
/// longer abbreviation such as <c>bzw.</c> still does; that costs the rest
|
||||
/// of a teaser, never the page.
|
||||
/// </para>
|
||||
@@ -276,10 +277,11 @@ public static partial class Markdown
|
||||
|
||||
/// <summary>
|
||||
/// Matches the end mark of a sentence: <c>.</c>, <c>!</c> or <c>?</c> before a
|
||||
/// space or the end, unless it follows a lone letter (<c>z.</c>) or a number
|
||||
/// (<c>13.</c>).
|
||||
/// space or the end, unless it follows a lone letter (<c>z.</c>) or an ordinal
|
||||
/// of one or two digits (<c>13.</c>). A longer number is a year (<c>2025.</c>),
|
||||
/// which German does not use as an ordinal, so its period ends the sentence.
|
||||
/// </summary>
|
||||
[GeneratedRegex(@"(?<!\b\p{L}|\b\d+)[.!?](?=\s|$)")]
|
||||
[GeneratedRegex(@"(?<!\b\p{L}|\b\d{1,2})[.!?](?=\s|$)")]
|
||||
private static partial Regex SentenceEnd();
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user