.appendChild(document.createElement("dd"))
.appendChild(document.createElement("a"))
a.href = status["@id"]
- const summaryText = (() => {
- try {
- const d = parser.parseFromString(status.content, "application/xhtml+xml")
- const div = document.createElement("div")
- div.appendChild(document.importNode(d.documentElement, true))
- Object.assign(div.style,
- { position: "absolute"
- , top: "-2px"
- , height: "1px"
- , width: "1px"
- , overflow: "hidden" })
- document.body.appendChild(div)
- const text = div.innerText
- document.body.removeChild(div)
- return text }
- catch { } })() || "";
- const chars = Array.from(summaryText.trim().replaceAll(/\s+/gu, " "))
- a.textContent = chars.length > 28
- ? "".concat(...chars.slice(0, 27), "…")
- : summaryText || status.identifier }
+ const { title } = status
+ if (title) a.textContent = title.length > 28
+ ? "".concat(...title.slice(0, 27), "…")
+ : title
+ else {
+ const summaryText = (() => {
+ try {
+ const d = parser.parseFromString(status.content, "application/xhtml+xml")
+ const div = document.createElement("div")
+ div.appendChild(document.importNode(d.documentElement, true))
+ Object.assign(div.style,
+ { position: "absolute"
+ , top: "-2px"
+ , height: "1px"
+ , width: "1px"
+ , overflow: "hidden" })
+ document.body.appendChild(div)
+ const text = div.innerText
+ document.body.removeChild(div)
+ return text }
+ catch { } })() || "";
+ const chars = Array.from(summaryText.trim().replaceAll(/\s+/gu, " "))
+ a.textContent = chars.length > 28
+ ? "".concat(...chars.slice(0, 27), "…")
+ : summaryText || status.identifier } }
if (next) {
const a = nav
.appendChild(document.createElement("p"))