diff --git a/src/components/alerts/AlertUtils.tsx b/src/components/alerts/AlertUtils.tsx index 529c075..d497d55 100644 --- a/src/components/alerts/AlertUtils.tsx +++ b/src/components/alerts/AlertUtils.tsx @@ -18,7 +18,7 @@ export const ParsedTtcAlertText = ({ const lineFilter = badge.line ? lineNum < 6 ? `${lineNum}` - : `${lineNum}` + : badge.line : badge.highlightAll ? parseLine(feedText) : ""; diff --git a/src/components/alerts/bsky-alerts/SkeetList.tsx b/src/components/alerts/bsky-alerts/SkeetList.tsx index 865156a..0c84084 100644 --- a/src/components/alerts/bsky-alerts/SkeetList.tsx +++ b/src/components/alerts/bsky-alerts/SkeetList.tsx @@ -1,6 +1,12 @@ import { type Skeet, SkeetElement } from "./Skeet.js"; import style from "./SkeetList.module.css"; +const parseFullLineNumber = (skeet: Skeet) => { + // Match the line number as well as any possible suffix (e.g. matches "96" or "96A") + const lineTextMatch = skeet.post.record.text.match(/^\d{1,3}\S/); + return lineTextMatch?.[0] ?? null; +}; + export const SkeetList = ({ skeetList, line, @@ -10,7 +16,10 @@ export const SkeetList = ({ line?: string; type?: string; }) => { - const badgeArg = line === "all" ? { highlightAll: true } : { line }; + const lineNumber = + skeetList?.length > 0 ? parseFullLineNumber(skeetList?.[0]) : line; + const badgeArg = + line === "all" ? { highlightAll: true } : { line: lineNumber }; const dataArray = skeetList.map((skeet) => ( ));