gitoriaLog in with ident

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3dc431083dc43108antcolony#40: mission references point to the moved missionsmre3dc43108/components/markdown.hl

4.0 KB

  1. // components/markdown.hl — A MARKDOWN TEXT, RENDERED (as tickets.worldapi.org components/markdown.hl,
  2. // for the repo homepage gitoria#8): `Markdown { blocks = … }` with the blocks of markdown.hl's
  3. // markdownBlocks. The blocks are plain data; every character of the source is a TEXT node here and a
  4. // link's href was checked by markdown.hl safeHref — no HTML string is ever built (no raw HTML, no
  5. // scripts, no `javascript:` links). The page owns h1 (the repo name): a README's `#` is an h2, `##`
  6. // an h3, deeper an h4. The span markup is written out once per block kind: a View has no macros.
  7. blocks = []
  8. View {
  9. markdownText {
  10. for (b of blocks) {
  11. if (b.isP) { p {
  12. for (s of b.spans) {
  13. if (s.isText) { s.text }
  14. if (s.isStrong) { strong { s.text } }
  15. if (s.isEm) { em { s.text } }
  16. if (s.isStrongEm) { strong { em { s.text } } }
  17. if (s.isCode) { code { s.text } }
  18. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  19. }
  20. } }
  21. if (b.isH1) { h2 {
  22. for (s of b.spans) {
  23. if (s.isText) { s.text }
  24. if (s.isStrong) { strong { s.text } }
  25. if (s.isEm) { em { s.text } }
  26. if (s.isStrongEm) { strong { em { s.text } } }
  27. if (s.isCode) { code { s.text } }
  28. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  29. }
  30. } }
  31. if (b.isH2) { h3 {
  32. for (s of b.spans) {
  33. if (s.isText) { s.text }
  34. if (s.isStrong) { strong { s.text } }
  35. if (s.isEm) { em { s.text } }
  36. if (s.isStrongEm) { strong { em { s.text } } }
  37. if (s.isCode) { code { s.text } }
  38. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  39. }
  40. } }
  41. if (b.isH3) { h4 {
  42. for (s of b.spans) {
  43. if (s.isText) { s.text }
  44. if (s.isStrong) { strong { s.text } }
  45. if (s.isEm) { em { s.text } }
  46. if (s.isStrongEm) { strong { em { s.text } } }
  47. if (s.isCode) { code { s.text } }
  48. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  49. }
  50. } }
  51. if (b.isQuote) { blockquote {
  52. for (s of b.spans) {
  53. if (s.isText) { s.text }
  54. if (s.isStrong) { strong { s.text } }
  55. if (s.isEm) { em { s.text } }
  56. if (s.isStrongEm) { strong { em { s.text } } }
  57. if (s.isCode) { code { s.text } }
  58. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  59. }
  60. } }
  61. if (b.isUl) { ul {
  62. for (it of b.items) { li {
  63. for (s of it.spans) {
  64. if (s.isText) { s.text }
  65. if (s.isStrong) { strong { s.text } }
  66. if (s.isEm) { em { s.text } }
  67. if (s.isStrongEm) { strong { em { s.text } } }
  68. if (s.isCode) { code { s.text } }
  69. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  70. }
  71. } }
  72. } }
  73. if (b.isOl) { ol { start = b.start
  74. for (it of b.items) { li {
  75. for (s of it.spans) {
  76. if (s.isText) { s.text }
  77. if (s.isStrong) { strong { s.text } }
  78. if (s.isEm) { em { s.text } }
  79. if (s.isStrongEm) { strong { em { s.text } } }
  80. if (s.isCode) { code { s.text } }
  81. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  82. }
  83. } }
  84. } }
  85. if (b.isCode) { pre { code { b.code } } }
  86. if (b.isHr) { hr { } }
  87. if (b.isTable) { tableScroll { table {
  88. thead { tr {
  89. for (c of b.head) { th {
  90. for (s of c.spans) {
  91. if (s.isText) { s.text }
  92. if (s.isStrong) { strong { s.text } }
  93. if (s.isEm) { em { s.text } }
  94. if (s.isStrongEm) { strong { em { s.text } } }
  95. if (s.isCode) { code { s.text } }
  96. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  97. }
  98. } }
  99. } }
  100. tbody {
  101. for (r of b.rows) { tr {
  102. for (c of r) { td {
  103. for (s of c.spans) {
  104. if (s.isText) { s.text }
  105. if (s.isStrong) { strong { s.text } }
  106. if (s.isEm) { em { s.text } }
  107. if (s.isStrongEm) { strong { em { s.text } } }
  108. if (s.isCode) { code { s.text } }
  109. if (s.isLink) { a { href = s.href rel = "nofollow noopener noreferrer" s.text } }
  110. }
  111. } }
  112. } }
  113. }
  114. } } }
  115. }
  116. }
  117. }

Branches

Latest commits

  • 3dc43108antcolony#40: mission references point to the moved missionsmre
  • 8d9450fdantcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
  • 205d5fe4gitoria: Hybriel master ff51cf46; ssh keys/tokens no double rows (session sync); gates follow #20mre
  • 9b27cb26gitoria#21: installable app (manifest, service worker, offline start page), own iconmre
  • 68dcb603deploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • e2deed6dgitoria#20: "Add code" only on the Code page of an empty repository, no collapsiblemre
  • 8bb97ffddeploy.sh: never send .git or .gitignore to Byrodinmre
  • fd981932State of 2026-09-27; bin/ no longer tracked (Hybriel commit is in README)mre
  • 4a2d7125initial commitmre