Skip to content

Commit

Permalink
Start attr for ordered lists
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Mar 11, 2024
1 parent 1ccade9 commit b69d04d
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 103 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import * as mds from "./smd.js"
import * as smd from "./smd.js"

async function main() {
const source_res = await fetch("readme.md")
const source_txt = await source_res.text()

const container = /** @type {HTMLElement} */(document.getElementById("markdown"))
const renderer = mds.default_renderer(container)
const renderer = smd.default_renderer(container)
// const renderer = mds.logger_renderer()
const parser = mds.parser(renderer)
const parser = smd.parser(renderer)

let i = 0
while (i < source_txt.length) {
const length = Math.floor(Math.random() * 20) + 1
const delay = Math.floor(Math.random() * 80) + 10
const chunk = source_txt.slice(i, i += length)
await new Promise(resolve => setTimeout(resolve, delay))
mds.parser_write(parser, chunk)
smd.parser_write(parser, chunk)
}

mds.parser_end(parser)
smd.parser_end(parser)
}

main()
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ smd.parser_end(parser)
- [x] With `___`
- [x] Unordered lists
- [x] Ordered lists
- [ ] `start` attr
- [x] `start` attr
- [x] Task lists
- [x] Nested lists
- [x] Blockquotes
Expand Down
Loading

0 comments on commit b69d04d

Please sign in to comment.