Skip to content

Commit

Permalink
Fix in tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Breck Yunits authored and Breck Yunits committed Feb 7, 2024
1 parent b158562 commit c1c70c5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions grammar/tables.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ rowParser
while (column < columnCount) {
const col = columns[column]
column++
const content = columnCount === column ? words.slice(columnCount - 1).join(" ") : words[column - 1]
const content = (columnCount === column ? words.slice(columnCount - 1).join(" ") : words[column - 1]) ?? ""
if (col.isLink) continue
let tagged = content
const link = words[col.linkIndex]
if (col.linkIndex > -1 && link) tagged = `<a href="${link}">${content}</a>`
else if (content && content.match(/^https?\:[^ ]+$/)) tagged = `<a href="${content}">${content}</a>`
else if (content.match(/^https?\:[^ ]+$/)) tagged = `<a href="${content}">${content}</a>`
str += `<td>${tagged}</td>\n`
}
return str
Expand Down
6 changes: 3 additions & 3 deletions grammar/treeTable.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ treeRowParser
str += "<td></td>\n"
return
}
const content = node.length ? node.childrenToString() : node.content
const content = (node.length ? node.childrenToString() : node.content) ?? ""
let tagged = ""
const link = this.get(col.name + "Link")
if (col.linkIndex > -1 && link) tagged = `<a href="${link}">${content}</a>`
else if (node.length) tagged = `<pre>${content ?? ""}</pre>`
else tagged = content ?? ""
else if (node.length) tagged = `<pre>${content}</pre>`
else tagged = content
str += `<td>${tagged}</td>\n`
})
return str
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "72.4.3",
"version": "72.4.4",
"description": "Tools for thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
3 changes: 3 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ title Scroll Release Notes

startColumns

# 72.4.4 2/07/2024
- 🏥 do not print "undefined" in tables in rows missing columns

# 72.4.3 11/04/2023
- 🏥 fix extra indentation in nested lists. Browser already adds it.

Expand Down

0 comments on commit c1c70c5

Please sign in to comment.