diff --git a/app/static/roles.js b/app/static/roles.js index 8c597a5..96d5ade 100644 --- a/app/static/roles.js +++ b/app/static/roles.js @@ -864,7 +864,8 @@ is the only time this page ever sees a role's `summary` or `description` directly. */ function excerptOf(role) { - const text = (role.summary || role.description || "").replace(/\s+/g, " ").trim(); + /* The server's order (`_EXCERPT_SOURCE`): summary, description, teaser. */ + const text = (role.summary || role.description || role.teaser || "").replace(/\s+/g, " ").trim(); if (text.length <= 200) return text; const cut = text.slice(0, 200); const space = cut.lastIndexOf(" "); @@ -1458,7 +1459,7 @@ async function fetchText(button) { const uid = state.readingUid; const role = await busy(button, "Fetching…", - () => api(`/api/roles/${encodeURIComponent(uid)}/text`, { method: "POST" })); + () => api(roleUrl(uid).replace(/(\?|$)/, "/text$1"), { method: "POST" })); if (role) merge(role); }