Commit graph

433 commits

Author SHA1 Message Date
Noah Hellman
6abe9e44c7 inline: mv symbol from span to event field 2023-05-15 19:05:22 +02:00
Noah Hellman
9676d9e5d6 inline: mv footnote label from span to event field 2023-05-15 19:05:22 +02:00
Noah Hellman
0a144574f4 inline: mv autolink url from span to event field 2023-05-15 19:05:22 +02:00
Noah Hellman
657b47df12 inline: mv raw format spec from span to event field 2023-05-15 19:05:22 +02:00
Noah Hellman
8be7c4c840 block: replace int literals with byte chars 2023-05-15 19:05:22 +02:00
Noah Hellman
c29b926d16 block: rm redundant block scope 2023-05-15 19:05:22 +02:00
Noah Hellman
7fc739cad4 afl_tmin: remove duplicate input files 2023-05-15 19:05:22 +02:00
Noah Hellman
0484ee2011 lib: make code block language non option
no distinction between empty language and None
2023-05-15 19:05:22 +02:00
Noah Hellman
e79f767604 lib: code block lang -> language 2023-05-15 19:05:22 +02:00
Noah Hellman
924a3c35bb lib: make div class non option
there is no distinction between an empty class and a None
2023-05-15 19:05:22 +02:00
Noah Hellman
116fb04725 lex: remove DollarBacktick token
can now read src to check dollar before backticks, so simpler to always
use backtick token

fixes several bugs, e.g.

| $`abc` | (previously did not get closed)

`$abc$` (previously did not get closed)
2023-05-15 19:05:22 +02:00
Noah Hellman
b2d15383e7 inline: allow empty span when followed by url/label/attrs
allow e.g. images without alt text ![](url)
2023-05-10 22:12:07 +02:00
Noah Hellman
329207689b prepass: fix lookup of headings
bug caused by confusing binary_search_by_key to be element instead of
index, both of which were usize
2023-05-10 22:04:01 +02:00
Noah Hellman
9efd4e4448 prepass: fix referenced headings with e.g. spaces
headings that did not exactly match their ids were previously not
matched with their reference
2023-05-10 22:04:01 +02:00
Noah Hellman
45c86da274 inline: fix unclosed attrs after cont/verb 2023-05-04 19:58:42 +02:00
Noah Hellman
9d9aded764 html: add doc comment to html::Renderer 2023-05-04 19:58:42 +02:00
Noah Hellman
e209143f54 PR #38 mv test suites from main crate
Merge branch 'test_crates'
2023-05-04 19:34:23 +02:00
Noah Hellman
2ca5f20eaf make: check no ignored tests pass 2023-05-04 19:34:23 +02:00
Noah Hellman
3cea79a122 mv suite{_bench} to test-html-{ut,ref} crates
- allow compiling/running html tests without compiling main crate tests
  (useful when e.g. making type changes to events but html unaffected)
- avoid need for future flags in main crate
2023-05-04 19:34:23 +02:00
Noah Hellman
d2a46663f1 html: fix initial newline when hr first element 2023-04-29 14:21:11 +02:00
Noah Hellman
9bbfb5ed75 make lint: run fmt after clippy
some files are created during build, fmt errors out on missing files
2023-04-29 14:21:11 +02:00
Noah Hellman
9a063d89a7 make lint: run clippy on whole workspace 2023-04-29 14:21:11 +02:00
Noah Hellman
d0ed14ae39 make: rm iai cachegrind files on clean 2023-04-27 21:03:32 +02:00
Noah Hellman
e8f2002c69 PR #36 Emit link defs/footnotes as encountered
Merge branch 'footnote'
2023-04-25 21:03:37 +02:00
Noah Hellman
99f4691e52 lib: emit footnotes as they are encountered
Previously, footnotes and their children events were skipped (stored in
block tree) and inline parsed at the end. Now, they are emitted by the
parser immediately and the responsibility to aggregate them has been
moved to the renderer.

resolves #31
2023-04-25 21:03:18 +02:00
Noah Hellman
c4ecd0c677 Revert "lib: add Render::render_{event, prologue, epilogue}"
This reverts commit e8503e28fd.

This imposed too many limitations on the renderer implementation. E.g.
making it impossible to store `Event<'s>`'s in the renderer struct.

Revert back to having the renderer struct separate from the implementor
of the Render trait. The implementor may instead create a renderer
struct without any restrictions.
2023-04-25 21:03:18 +02:00
Noah Hellman
8e48021f7a lib: emit LinkDefinition event
resolves #14
2023-04-25 21:03:18 +02:00
Noah Hellman
17b166867f html: derive Renderer::default
setting defaults manually mostly causes rebase conflicts
2023-04-25 21:03:18 +02:00
Noah Hellman
1b90ba9423 bench: add block_footnotes benchmark
current benchmarks do not contain a single footnote
2023-04-25 21:03:18 +02:00
Noah Hellman
ebe7a913bf suite: add footnotes unit tests
complementary to ones borrowed from djot.js suite
2023-04-25 21:03:18 +02:00
Noah Hellman
00d653e12d make: only rm symlink tests
avoid deleting own tests
2023-04-25 21:03:18 +02:00
Noah Hellman
91ae737be3 suite: prepend djot_js tests
avoid name conflicts when adding own tests
2023-04-25 21:03:18 +02:00
Noah Hellman
6611404992 add helper script to tag release 2023-04-25 20:58:59 +02:00
Noah Hellman
d61a9fa4a9 Release 0.2.1 2023-04-25 20:31:50 +02:00
Noah Hellman
bdab4f021b lex: eat non special chars separately
let tight loop work as long as there no special characters
2023-04-25 20:26:47 +02:00
Noah Hellman
3701d282ac lex: separate escaped/non-escaped 2023-04-25 20:26:47 +02:00
Noah Hellman
e877fdbde8 inline: rm resolved TODO
resolved by a846477cea
2023-04-25 18:35:13 +02:00
Noah Hellman
ab33adc799 lib: cfg guard doctests using html renderer
docs do not compile when html feature is off otherwise
2023-04-25 18:35:10 +02:00
Noah Hellman
3cde744fc1 readme: add useful links to top 2023-04-11 20:21:29 +02:00
Noah Hellman
176d026cbb PR #35 Check event balance when fuzzing
Merge branch 'balance'
2023-04-10 18:58:44 +02:00
Noah Hellman
d2d7f5d474 lib: fix url in autolink/email end event
was constant ">" instead of actual url
2023-04-10 18:50:22 +02:00
Noah Hellman
3c17d6df49 afl: add target parse_balance
verify all containers are balanced
2023-04-10 18:50:21 +02:00
Noah Hellman
88a872cd88 ci: use matrix for fuzz targets
to make them run in parallel
2023-04-10 18:50:05 +02:00
Noah Hellman
5de8543bb0 bench: mv input files to bench/input
only used by input crate, avoid cluttering bench dir
2023-04-10 11:49:03 +02:00
Noah Hellman
bee3d5d747 bench/suite_bench: use snake case for input files
rust identifiers may not contain -

use _ for files also to avoid confusion of having two names
2023-04-10 11:49:03 +02:00
Noah Hellman
9bdb4c59fc suite make: specify gawk
broken for e.g. nawk

TODO: fix to work with any awk or replace awk script with something else
(e.g. separate crate with build.rs?)
2023-04-09 16:17:14 +02:00
Noah Hellman
b6300d22df Release 0.2.0 2023-04-05 21:17:33 +02:00
Noah Hellman
a2adb40629 cargo: exclude dirs from package
unneeded files for downstream
2023-04-05 21:17:33 +02:00
Noah Hellman
91b6649fa8 PR #30 Inline parser overhaul
Merge branch 'inline_perf'
2023-04-05 21:17:33 +02:00
Noah Hellman
7a10767fed jotdown_wasm: display version
mostly useful for the hosted version
2023-04-05 21:17:33 +02:00