Commit graph

115 commits

Author SHA1 Message Date
Noah Hellman
c3ff064c78 make Event::is_{,container_}block public
this is only used by html renderer, may be useful for other renderers
also
2023-02-12 00:59:18 +01:00
kmaasrud
d7f2c0a819 implement Render trait for html::Renderer 2023-02-10 09:46:18 +01:00
kmaasrud
4743781cb9 add Render trait 2023-02-10 09:45:43 +01:00
Noah Hellman
0d560901eb block: add Element::list 2023-02-07 21:49:35 +01:00
Noah Hellman
34452a282a features: add flag for html module 2023-02-05 21:59:38 +01:00
Noah Hellman
0de7776020 impl Clone, Copy on public objects 2023-02-05 20:36:49 +01:00
Noah Hellman
477eadde1c document lib API 2023-02-05 20:36:49 +01:00
Noah Hellman
5efb700c9b move atomic events to Event from Atom
An additional Atom enum seems to be more cumbersome and add little
value.

methods could potentially be used to classify events in several ways,
e.g.  block vs inline, atomic vs container
2023-02-05 20:36:49 +01:00
Noah Hellman
0420aad0a5 implement symbols
e.g. :some-sym:
2023-02-05 20:36:49 +01:00
Noah Hellman
fbd8811c86 block: parse description list 2023-02-05 20:36:49 +01:00
Noah Hellman
768699d138 optionally use btree maps instead of hash maps
btree maps are deterministic which is useful for fuzzing. hash maps,
however have better performance in our case
2023-02-05 20:36:49 +01:00
Noah Hellman
82adc631d9 allow attributes on thematic breaks 2023-02-05 20:36:49 +01:00
Noah Hellman
ca7f3c7e89 do not treat \0 as EOF
may appear in input
2023-02-05 20:36:49 +01:00
Noah Hellman
1bbfd4a96a prepass: avoid consecutive '-' in heading id 2023-02-05 20:36:49 +01:00
Noah Hellman
87d4f7c270 prepass: use hash set to avoid duplicate heading ids
linear lookup becomes problematic for large amount of headings with same
title
2023-02-05 20:36:40 +01:00
Noah Hellman
dc38076f50 block: limit ordered list number width
use 64-bit to not let limit be too low, 32-bit allows for only 6 alpha
digits, "zzzzzz".
2023-02-05 20:36:40 +01:00
Noah Hellman
de7404137e parser: keep inlines of code blocks verbatim 2023-02-05 20:36:40 +01:00
Noah Hellman
60dcf09c1a impl automatic heading identifiers 2023-02-05 20:36:40 +01:00
Noah Hellman
b726580724 parser: fix end section eating block attributes 2023-02-05 20:36:40 +01:00
Noah Hellman
7b8157cb51 fixup! parse inline attrs 2023-02-05 20:36:40 +01:00
Noah Hellman
3e8b80059e fixup! parser: impl link references 2023-02-05 20:36:40 +01:00
Noah Hellman
493a9b3563 heading event: limit level to u16 2023-02-05 20:36:40 +01:00
Noah Hellman
1135cf7054 fixup! block: parse tables 2023-02-05 20:36:40 +01:00
Noah Hellman
dcb3b787a2 block: add MeteredBlock as intermediate struct 2023-02-05 20:36:40 +01:00
Noah Hellman
530820a04e block: add hierarchical heading sections 2023-02-05 20:36:40 +01:00
Noah Hellman
1f47a1729e parser: impl autolinks 2023-02-05 20:36:40 +01:00
Noah Hellman
2e992f5726 fixup! parser: allow linebreak in text of link tag refs 2023-02-05 20:36:40 +01:00
Noah Hellman
9fd10683c5 parser: throw away link-def/footnote attrs
prevent attributes on link definitions and footnotes from applying to
upcoming elements
2023-02-05 20:36:40 +01:00
Noah Hellman
2e4a9147aa parser: apply link def attrs to link 2023-02-05 20:36:40 +01:00
Noah Hellman
9fdd402d07 parser: allow linebreak in text of link tag refs
e.g.

    [my
    link][]

will link to

    [my link]: url
2023-02-05 20:36:40 +01:00
Noah Hellman
8b8ccd65bb fixup! parse: merge enter / exit block events match branch 2023-02-05 20:36:40 +01:00
Noah Hellman
56718ef887 inline: impl smart quotation 2023-02-05 20:36:40 +01:00
Noah Hellman
8339befe2f block: parse captions 2023-02-05 20:36:40 +01:00
Noah Hellman
c288264aee block: parse tables 2023-02-05 20:36:40 +01:00
Noah Hellman
5714e72939 parser: parse roman numerals 2023-02-05 20:36:40 +01:00
Noah Hellman
a661a2febb parser: parse AlphaLower/Upper numbers 2023-02-05 20:36:40 +01:00
Noah Hellman
e5c4ca5450 fixup! 238e445f3012485d96aba81ca01ee45d7ba97370 2023-02-05 20:36:40 +01:00
Noah Hellman
ec69d98c75 amend! parser: determine tight vs loose lists
block: determine tight vs loose lists
2023-02-05 20:36:40 +01:00
Noah Hellman
69d51a5032 fixup! parser: determine tight vs loose lists 2023-02-05 20:36:40 +01:00
Noah Hellman
845c56fd0b parser: test nested list 2023-02-05 20:36:40 +01:00
Noah Hellman
70d29c65e4 parser: determine tight vs loose lists 2023-02-05 20:36:40 +01:00
Noah Hellman
36470af114 tmp remove this 2023-02-05 20:36:40 +01:00
Noah Hellman
7b018ef10c todo: allow roman in alpha 2023-02-05 20:36:40 +01:00
Noah Hellman
83d569d09a fixup! 1669f0e97379fe38e7df6206d1e6815c5e8730fb 2023-02-05 20:36:40 +01:00
Noah Hellman
4ad7e2bf3e fixup! a931e71100663ece89f3c8dbfa67c02414d40436 2023-02-05 20:36:40 +01:00
Noah Hellman
2f616c41b7 parser: parse lists and list items 2023-02-05 20:36:40 +01:00
Noah Hellman
6befcad52a parse: merge enter / exit block events match branch 2023-02-05 20:36:40 +01:00
Noah Hellman
50632204a3 block: emit list events around list items 2023-02-05 20:36:40 +01:00
Noah Hellman
5e8c683050 fixup! tree: add tree branch reference 2023-02-05 20:36:40 +01:00
Noah Hellman
a62eb3e1d8 fixup! e1843f1913dbbbc85414b05268ef554676168a6b 2023-02-05 20:36:40 +01:00