Commit graph

345 commits

Author SHA1 Message Date
Noah Hellman
0ef3681b1b jotdown_wasm: add output option for indented events
make events more readable, more resembling an AST
2023-04-05 21:17:33 +02:00
Noah Hellman
f3732693c6 jotdown_wasm: add option to show events
provide 1:1 representation of events to help explore how events are
emitted
2023-04-05 21:17:33 +02:00
Noah Hellman
f31398a796 attr: impl Debug for Attributes manually
show key value pairs instead of internal structure
2023-04-05 21:17:33 +02:00
Noah Hellman
122cb84d2d jotdown_wasm: use full viewport 2023-04-05 21:17:33 +02:00
Noah Hellman
d5803c4a12 jotdown_wasm: create html wrapper
demo.html can be included in another html file, create a html file that
includes demo.html for the demo, rather than using demo.html directly
and letting the browser add <html>, <body> etc
2023-04-05 21:17:33 +02:00
Noah Hellman
4cacb61a68 jotdown_wasm: rm unmatched closing div 2023-04-05 21:17:33 +02:00
Noah Hellman
d175ab4f47 jotdown_wasm: rm debug print 2023-04-05 21:17:33 +02:00
Noah Hellman
8893281310 PR #29 Allow rendering borrowed events
Merge branch 'render_ref'

closes #29
2023-04-05 21:17:33 +02:00
Noah Hellman
7fcc802415 make: nonzero exit when afl_quick detects crashes
ci job still goes green when fuzzing fails, otherwise
2023-04-05 21:17:33 +02:00
Noah Hellman
5daa160288 bench-crit: add html_borrow, html_clone
allow comparing between rendering owned, borrowed or cloned events
2023-04-05 21:17:33 +02:00
Noah Hellman
5e2d567a54 PR #27 Expose tag for unresolved links
Merge branch 'unresolved_links'

closes #27
2023-04-05 21:17:33 +02:00
Noah Hellman
10788af246 lib: add Render::{push, write}_borrowed
allow rendering iterators with borrowed events

resolves #24
2023-04-05 21:17:33 +02:00
Noah Hellman
e8503e28fd lib: add Render::render_{event, prologue, epilogue}
derive push/write automatically from these
2023-04-05 21:17:33 +02:00
Noah Hellman
e506fffed8 mv push/write examples from html to Render trait
They apply more to the Render trait now than the implementation in the
html module
2023-04-05 21:17:33 +02:00
Noah Hellman
8eafdf073b html: extract Writer::render_{event, epilogue} 2023-04-05 21:17:33 +02:00
Noah Hellman
3d1b5f2115 html: rm events/out from Writer
separate input/output from rendering state
2023-04-05 21:17:33 +02:00
Noah Hellman
f5724fcc9c html: rm FilteredEvents
no longer useful as no peeking is needed, use simple early exit instead
2023-04-05 21:17:33 +02:00
Noah Hellman
336927faef html: avoid peek of next event
Try to make rendering of each event independent.

The only case where we need to peek is when a backref link should be
added to the last paragraph within a footnote.

Before, when exiting a paragraph, we would peek and add the link before
emitting the close tag if the next event is a the footnote end.

Now, the paragraph end event skips emitting a paragraph close tag if it
is within a footnote. The next event will then always close the
paragraph, and if it is a footnote end, it will add the backref link
before closing.
2023-04-05 21:17:33 +02:00
Noah Hellman
a603ea2124 lib: Add SpanLinkTag::Unresolved variant
keep the tag for unresolved links, and allow distinguishing between
`[tag][tag with empty url]` and `[tag][non-existent tag]`.

closes #26
2023-04-05 21:17:32 +02:00
Noah Hellman
05a4992d99 lib: don't prepend mailto to url in autolink Event
better to provide the original url, the event is already tagged as email

also avoids a string allocation
2023-04-05 21:17:04 +02:00
Noah Hellman
62e73100a6 bug fix: set LinkType to Email for email autolinks 2023-03-20 23:39:51 +01:00
Noah Hellman
e458955d00 PR #25 Fuzz for invalid HTML
Merge branch 'fuzz_html'

closes #25
2023-03-20 23:37:54 +01:00
Noah Hellman
ac49c92445 changelog: fix release link 2023-03-18 15:09:59 +01:00
Noah Hellman
6266e6eb49 ci: add fuzz html step 2023-03-17 19:01:29 +01:00
Noah Hellman
14065177ae attr: fix name/key/value validation
match reference implementation
2023-03-17 18:57:36 +01:00
Noah Hellman
0719b2de65 block: fix class attribute parsing
match reference implementation
2023-03-17 18:57:36 +01:00
Noah Hellman
33d8215a2a html: fix invalid html for footnote inside image 2023-03-17 18:57:36 +01:00
Noah Hellman
c6022004bb html: fix alt text on nested images 2023-03-17 18:57:35 +01:00
Noah Hellman
fc374be56c html: escape img src values 2023-03-17 18:57:10 +01:00
Noah Hellman
5768b24907 html: escape quotes in img alt text 2023-03-17 18:45:20 +01:00
Noah Hellman
bd831058f7 make: add afl_tmin target
minimize all failing cases to help debugging
2023-03-17 18:45:20 +01:00
Noah Hellman
0d884a65d5 afl: add debug feature
leave out debug prints when actually fuzzing to increase fuzz
performance
2023-03-17 18:45:20 +01:00
Noah Hellman
9a7c57f524 afl: add html target, checking for invalid html 2023-03-17 18:45:20 +01:00
Noah Hellman
8f70f596b9 afl: add main file
for testing that crashes have been resolved

previously, binary of the main crate was used, but targets may have more
validation than simply checking for panics
2023-03-17 18:45:20 +01:00
Noah Hellman
3e56903885 afl: mv parse target impl to lib 2023-03-17 18:45:20 +01:00
Noah Hellman
2606e2f4fc afl: gen -> parse, parse only 2023-03-17 18:45:20 +01:00
Noah Hellman
648a6dbef2 lib: derive Clone for Event and Container 2023-03-16 20:05:20 +01:00
Noah Hellman
16491a4a99 PR #19 Support escapes in attributes 2023-03-12 10:25:31 +01:00
kmaasrud
e3f39d4b88
feat: support escapes in attributes
Related issue: #1
2023-03-12 08:19:56 +01:00
Noah Hellman
a7f5b337a8 inline: fix attrs missing for inline verbatim
closes #15
2023-03-11 22:16:56 +01:00
Noah Hellman
418bb38f82 inline: extract ahead_container_attributes 2023-02-21 17:58:05 +01:00
Noah Hellman
1eb3bd12d0 PR #11 criterion/iai benchmarks
closes #2
closes #11
2023-02-14 22:08:14 +01:00
Noah Hellman
518d06058c ci: run on push to master 2023-02-14 21:51:23 +01:00
Noah Hellman
c1c59d02fb ci: add benchmark task 2023-02-14 21:51:23 +01:00
Noah Hellman
209995b3d9 readme: describe running benchmarks 2023-02-14 21:51:23 +01:00
Noah Hellman
a36cb74c66 add iai benchmarks 2023-02-14 21:51:23 +01:00
Noah Hellman
4f0be0c265 add criterion benchmarks 2023-02-14 21:51:23 +01:00
Noah Hellman
6ce49e1a71 add bench input crate
generate const strings to use as input in benchmarks
2023-02-14 21:51:23 +01:00
Noah Hellman
a3351d28b7 use bench instead of benches dir for benchmarks
in order to be able to place benchmarks in separate crates, if placed in
benches, they will be automatically considered part of the main crate

separate crates are needed to

- share generated input crate,
- avoid adding unused dependencies to tests
2023-02-14 16:31:58 +01:00
Noah Hellman
be63583257 rm unused benches/bench.sh script 2023-02-14 16:31:58 +01:00