Commit graph

124 commits

Author SHA1 Message Date
Noah Hellman
722f549ffd clippy: allow blocks_in_if_conditions everywhere 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
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
648a6dbef2 lib: derive Clone for Event and Container 2023-03-16 20:05:20 +01:00
kmaasrud
e3f39d4b88
feat: support escapes in attributes
Related issue: #1
2023-03-12 08:19:56 +01:00
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