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
- fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmre
- e448e656Tickets conductor: STATUS #51mre
- 1c10857bTickets conductor: P51 eval, brief 027mre
- e725969dTickets conductor: #51 directionmre
- 1b5c63ddTickets conductor: P51 startedmre
- 9f13fbdaTickets conductor: brief 026 prioritymre
- acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
- 9233a734Tickets conductor: brief 026 completemre
- 5da589fdTickets conductor: brief 026 + Gitoria's answermre
- a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
- 6f6e5797Tickets conductor: STATUS wordingmre
- 957de51fTickets conductor: T36 live, #36 review, #50 donemre
- bc2fde32Merge branch 'main' into t36-stylemre
- b7ca093atests: wait for the new row and normalize editor marker spacesmre
- 41da3525Tickets conductor: flake cause, T36 deploy stepmre
- 64c477e6Tickets conductor: deploy waits for Arachnemre
- 467d7286Tickets conductor: T36 done, deploy questionmre
- fed5ca81ticket_list: remove repeated selected-state coloursmre
- 8542fc8aTickets conductor: T36 proof reviewedmre
- 35980936inbox: preserve desktop columns after list styles were scopedmre