tickets
All repositories: gitoria
2.4 KB
// lib/import.hl — the AntColony ticket file format (the import's parser), shared by tools/import.hl and the one-off// tools/fix-import-summaries.hl. Statics only (no top-level work: importing it runs nothing).//// A ticket file is `project:` and `subject:` header lines, a blank line, the summary.// The summary is HARD-WRAPPED text: lines are joined into paragraphs (one space between// them), a blank line starts a new paragraph, a list line starts a new line; paragraphs are separated by one empty line// ("\n\n") in the stored summary, which the ticket page renders with `white-space: pre-wrap`.// CRLF files work: every line is trim()med, which drops the carriage return. (Hybriel// strings have no escapes — "\r" would be two characters, so there is no CR constant.)static NL = ""// A MARKDOWN LIST LINE (`- `, `* `, `1. ` after trimming) stays its own line (ticket #15):// it starts a new line inside the paragraph ("\n"); a following ordinary line is still// joined onto it (a wrapped list item). Nested indentation is not kept.static isListLine = (line) => {if (line.startsWith('- ') || line.startsWith('* ')) { return true }let i = 0while (i < line.length && line.charCodeAt(i) >= 48 && line.charCodeAt(i) <= 57) { i = i + 1 }return i > 0 && line.slice(i, i + 2) == '. '}// hard-wrapped text → paragraphs joined by "\n\n" (list lines inside one by "\n")static paragraphsOf = (text) => {paras = []let cur = []for (raw of text.split(NL)) {let line = raw.trim()if (line == '') {if (cur.length > 0) { paras.push(cur.join(NL)) }cur = []} else if (cur.length == 0 || isListLine(line)) {cur.push(line)} else {cur[cur.length - 1] = cur[cur.length - 1] + ' ' + line}}if (cur.length > 0) { paras.push(cur.join(NL)) }return paras.join(NL + NL)}// { project, subject, summary } or { error }static parse = (text) => {lines = text.split(NL)head = {}let i = 0while (i < lines.length && lines[i].trim() != '') {let line = lines[i]let c = line.indexOf(':')if (c > 0) { head[line.slice(0, c).trim().toLowerCase()] = line.slice(c + 1).trim() }i = i + 1}body = []i = i + 1while (i < lines.length) {body.push(lines[i])i = i + 1}if (head.project == null || head.project == '') { return { error = 'no project: line' } }if (head.subject == null || head.subject == '') { return { error = 'no subject: line' } }return { project = head.project subject = head.subject summary = paragraphsOf(body.join(NL)) }}
Branches
Latest commits
- 2558f56cst2-sec: keep the hlsid session cookie name (no one is signed out), Secure flag only; gate: a cookie issued by main stays signed in; ident stub serves selector.js; security.mjs in deploy GATESmre
- ea2e440esecurity audit (ST): JSON body cap, relation rights, login session rotation, __Host- Secure cookie, API security headers, CSP+referrer meta, /connect cap, one-line subjects, tests/security.mjs, reportmre
- 7c8c2282sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- b6277497report MT-mobile, LOGmre
- 6709398blist paging: the newest rows come first (the sorted array was not used); filter rows hide their scrollbar; gate checks the ordermre
- 31736a80gate: member-name check fails on the old row layout toomre
- e03ae537gate: the phone checks run on without the Show more button (so old code reports every failed check)mre
- adf7f132gate: 390 px checks for the mobile audit fixes (row number, filters, field widths, Edit, member names, relation taps, paging)mre
- 28e9c938ticket list: draw the newest 50 rows and a Show more button (500 rows were a 2-4 s first paint, 740 KB, a 90 000 px phone page)mre
- ccebb0c7mobile: ticket number stays on one line, filter chips one scrolling row, fields full width under their caption, Edit/action buttons, member names whole, 44 px relation linksmre
- f2dc7741gate: the phone toolbar is two even rows (E2)mre
- 20f7c33async components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
- d74a5482sync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
- 9d02c540sync components.hybriel 6b0936a: the 'edited' foldable drops the theme's border and marginmre
- 22751914sync components.hybriel 8d79ff7: bubble hugs its content, quiet 'edited' label; gate checksmre
- c8452453sync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
- 52ba11e8sync-components: copy icons/icons.hl + README (F4); testsmre
- 138d198dmd-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
- 18d2df60md-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
- f6764bedreports/H1-hydrate.mdmre