tickets
All repositories: gitoria
6.3 KB
// components/markdown.hl — A MARKDOWN TEXT, RENDERED (ticket #6): `Markdown { blocks = … }` with the// blocks of markdown.hl's markdownBlocks (the summary, a comment, a state note). The blocks are// plain data; every character of the source is a TEXT node here and a link's href was checked// by markdown.hl safeHref — no HTML string is ever built (no raw HTML, no scripts, no// `javascript:` links). Headings of the text become h3/h4/h5 (the page owns h1/h2). A table// (mission 013) is <markdown-table><table> with <th>/<td> carrying data-align (left/center/right/'').// The span markup is written out once per block kind: a View has no macros.blocks = []Style {markdownText {display = 'block'// Keep the combinator as a quoted nested key.'> :first-child' {marginTop = '0'}// Keep the combinator as a quoted nested key.'> :last-child' {marginBottom = '0'}p {whiteSpace = 'pre-wrap'margin = '.5rem 0'}h3 {margin = '.9rem 0 .4rem'lineHeight = '1.3'color = 'var(--color-text-strong)'fontSize = '1.15rem'}h4 {margin = '.9rem 0 .4rem'lineHeight = '1.3'color = 'var(--color-text-strong)'fontSize = '1.02rem'}h5 {margin = '.9rem 0 .4rem'lineHeight = '1.3'color = 'var(--color-text-strong)'fontSize = '.95rem'}ul {margin = '.5rem 0'paddingLeft = '1.4rem'listStyleType = 'disc'}ol {margin = '.5rem 0'paddingLeft = '1.4rem'listStyleType = 'decimal'}li {whiteSpace = 'pre-wrap'// Keep the combinator as a quoted nested key.'+ li' {marginTop = '.15rem'}}strong {color = 'var(--color-text-strong)'}a {textDecoration = 'underline'textUnderlineOffset = '.15em'overflowWrap = 'anywhere'}code {font = '.88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'padding = '.05em .3em'color = 'var(--color-text-strong)'background = 'var(--color-background-sunken)'borderRadius = 'var(--radius-small)'}pre {margin = '.5rem 0'padding = '.6rem .7rem'overflowX = 'auto'background = 'var(--color-background-sunken)'borderRadius = 'var(--radius-small)'code {padding = '0'background = 'transparent'whiteSpace = 'pre'}}}markdownTable {display = 'block'maxWidth = '100%'overflowX = 'auto'margin = '.5rem 0'padding = '1px'contain = 'inline-size'table {borderCollapse = 'collapse'}th {padding = '.3rem .6rem'textAlign = 'start'verticalAlign = 'top'minWidth = '2.5rem'overflowWrap = 'normal'wordBreak = 'normal'fontWeight = '700'color = 'var(--color-text-strong)'}td {padding = '.3rem .6rem'textAlign = 'start'verticalAlign = 'top'minWidth = '2.5rem'overflowWrap = 'normal'wordBreak = 'normal'}// Keep the attribute selector; there is no bare form.'[data-align="left"]' {textAlign = 'left'}// Keep the attribute selector; there is no bare form.'[data-align="center"]' {textAlign = 'center'}// Keep the attribute selector; there is no bare form.'[data-align="right"]' {textAlign = 'right'}}}View {markdownText {for (b of blocks) {if (b.isP) { p {for (s of b.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }if (b.isH1) { h3 {for (s of b.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }if (b.isH2) { h4 {for (s of b.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }if (b.isH3) { h5 {for (s of b.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }if (b.isUl) { ul {for (it of b.items) { li {for (s of it.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }} }if (b.isOl) { ol { start = b.startfor (it of b.items) { li {for (s of it.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }} }if (b.isCode) { pre { code { b.code } } }// mission 013: a pipe table, in a box that scrolls sideways when it is wider than the textif (b.isTable) { markdownTable { table {thead { tr {for (c of b.head) { th { "data-align" = c.alignfor (s of c.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }} }tbody {for (r of b.rows) { tr {for (c of r.cells) { td { "data-align" = c.alignfor (s of c.spans) {if (s.isText) { s.text }if (s.isStrong) { strong { s.text } }if (s.isEm) { em { s.text } }if (s.isStrongEm) { strong { em { s.text } } }if (s.isCode) { code { s.text } }if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }}} }} }}} } }}}}
Branches
Latest commits
- 11dc8dea|||PR Document offline shell and keyed ordering framework gapsmre
- ed091d44Merge branch 'records' into mainTickets
- 180c0cdb|||PR records: ticket move live (M32), hybriel#439mre
- 497cae7bMerge branch 'm32-move' into mainTickets
- 772e0696|||PR Allow project admins to move tickets between their projectsmre
- be92a560Merge branch 'records' into mainTickets
- 0daf2ea8|||PR records: PR-only workflow, #50 donemre
- 0185d0b6Log PR 1 deploymre
- f5bf16e2Mission 031: deploy PR 1mre
- c69cd5f3Merge branch 'pr-flow' into mainTickets
- cc56798cLog gitoria PR-only requestmre
- d876d0b2|||PR README: changes land as PRsmre
- fd83ac1fconductor: caramboleyo is the user, not owner/creatorApollo
- 3b858c91Log backup hard-link fixmre
- 7f6b37a0deploy.sh backup: tar --hard-dereference (hard links broke mpackdb sidecars on restore)mre
- e93711d9Log E30 livemre
- 59c02e4dMerge e30: preserve edited state note labels in Markdownmre
- 30970796Log E30 deploy GOmre
- 7c8e6d83Limit edited state note fix to Markdown renderingmre
- 910536d0Log E30 reviewmre