tickets
All repositories: gitoria
6.5 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 {// Line breaks inside a paragraph stay visible (the page showed the texts with pre-wrap before)markdownText { display = 'block''> :first-child' { marginTop = '0' }'> :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' }// inside the history (itself an <ol>) a list would get the nested markers (circles): the list style is set hereul { margin = '.5rem 0' paddingLeft = '1.4rem' listStyleType = 'disc' }ol { margin = '.5rem 0' paddingLeft = '1.4rem' listStyleType = 'decimal' }li { whiteSpace = 'pre-wrap''+ 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' }}}// mission 013: pipe tables, black/white, thin grey lines; a wide table scrolls inside its own box (the page never scrolls sideways);// cells keep their words whole (no break-all) and wrap at spaces. `contain: inline-size`: the box's width never comes from the table,// the history and the sections are grids of auto columns, which would otherwise grow to the table's min-content width and push the// page sideways. The 1px padding keeps the outer half of the collapsed border inside the clipmarkdownTable { 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' }'[data-align="left"]' { textAlign = 'left' }'[data-align="center"]' { textAlign = 'center' }'[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
- 93348453Re-vendor tickets to Hybriel set day35mre
- a4123831tickets#42: the /connect and /login/callback error pages are app pages: the function routes redirect to /connect/failed/<code> and /login/failed/<code> (components/problem.hl, sentences in lib/problems.hl), htmlPage and its hand-written stylesheet are gone; gate tests/error-pages.mjsmre
- cefc7b4atickets: a startup error prints its message before exit 1 (hybriel#247)mre
- 99bd6570tickets: lib/migrate.hl writes no table of another topic any more: projects.hl rewriteSlug / addProjectNamed / hasMembers, tickets.hl moveToProject / ticketRecords / ticketRecordsOf, events.hl renameStates / eventRecords / eventRecordsOf; the migration calls them (tickets#47)mre
- b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre
- f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
- 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
- 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
- d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
- afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre
- 8a69999cident#28: /login/callback never signs out the session it finds; a valid code puts the user on the same sessionmre
- 337e9b21tickets#37: a comment's files are open to everyone who can read the commentmre
- 1800600ftickets: write the standby service out in full so the boot gate can read the main servicemre
- 8179d287tickets: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 0398145ctickets: the table grid rule is marked functional for check-thememre