Commit graph

379 commits

Author SHA1 Message Date
Noah Hellman
cee759f751 lib: uncomment tests
was accidentally committed
2023-06-25 14:32:49 +02:00
Noah Hellman
2ea095730c lib: replace custom Span with Range<usize> 2023-05-16 17:01:42 +02:00
Noah Hellman
3908823d18 inline: use bytes instead of chars 2023-05-16 17:01:42 +02:00
Noah Hellman
eaa21fd393 prepass: consider only ascii whitespace 2023-05-16 17:01:42 +02:00
Noah Hellman
72a3378831 attr: use bytes instead of chars
only consider ascii whitespace
2023-05-16 17:01:42 +02:00
Noah Hellman
798f8941d8 lex: use bytes instead of chars
All special characters are ascii (within 00-7f), so chars aren't
required. Using bytes will make it easier to use SIMD instructions.

Some places in inline.rs have required changes because there is no
longer any guarantee that the token/event spans are aligned to utf-8
chars. Calling event.span.of(src) may now cause a panic.
2023-05-16 17:01:42 +02:00
Noah Hellman
55234bf193 block: consider only ascii whitespace 2023-05-16 17:01:42 +02:00
Noah Hellman
d43d6c908f attr: valid, ret byte len not char count 2023-05-16 17:01:42 +02:00
Noah Hellman
599b712f36 attr: rm unused ret bool from valid 2023-05-16 17:01:42 +02:00
Noah Hellman
c804e666ec inline: do not parse attrs in verbatim
fixes #41
2023-05-16 16:59:20 +02:00
Noah Hellman
68a5a34f7b block: rm unused Display impls 2023-05-15 21:57:56 +02:00
Noah Hellman
bbdb314ae1 parse: do not inline parse link definitions
better match the actual url produced, which is verbatim
2023-05-15 19:05:22 +02:00
Noah Hellman
79b5119209 parse: add Parser::into_offset_iter
resolves #3
2023-05-15 19:05:22 +02:00
Noah Hellman
b6b3a6f40b parse: only get block span content when needed 2023-05-15 19:05:22 +02:00
Noah Hellman
f5c87f32f9 inline: include attribute in end event span 2023-05-15 19:05:22 +02:00
Noah Hellman
42ce9a3670 block: include attributes in open event span 2023-05-15 19:05:22 +02:00
Noah Hellman
b0f88230aa parse: do not attach block attributes to outer blocks
e.g.

    - {.inner}

    this paragraph would get the inner class previously
2023-05-15 19:05:22 +02:00
Noah Hellman
c377aa9998 block: ensure section span end before attrs
e.g

    # sec1
                        <-- end sec1 here
    {.sec2-class0}
    {.sec2-class1}      <-- instead of here
    # sec2
2023-05-15 19:05:22 +02:00
Noah Hellman
edd89f2b20 block: expand parse_attr test 2023-05-15 19:05:22 +02:00
Noah Hellman
e84385c2db block: replace tree with event vec
a lot simpler to use and reason about

should also make it easier to move to streaming
2023-05-15 19:05:22 +02:00
Noah Hellman
5e99d98f4f block: use separate spans for start/end events 2023-05-15 19:05:22 +02:00
Noah Hellman
631c9eff42 block: extend parse_description_list 2023-05-15 19:05:22 +02:00
Noah Hellman
8d1381144e block: extend parse_code_block 2023-05-15 19:05:22 +02:00
Noah Hellman
c21138d5b9 block: extend parse_table_align 2023-05-15 19:05:22 +02:00
Noah Hellman
4f863f91d5 block: add test parse_description_list_empty 2023-05-15 19:05:22 +02:00
Noah Hellman
d9804d963c block: add parse_table_empty 2023-05-15 19:05:22 +02:00
Noah Hellman
ee9ea2e023 block: specify heading pos in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
898ed90a24 block: specify div class in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
6cebdfcc0c block: specify footnote label in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
116245367a block: specify task check in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
6200b07287 block: specify list marker in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
dbedeeb5ee block: specify lang in code block event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
e90594f2b7 block: specify link def label in event
instead of using span
2023-05-15 19:05:22 +02:00
Noah Hellman
bc4dd794bc block: store level in event
do not use span length as level
2023-05-15 19:05:22 +02:00
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
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
d2a46663f1 html: fix initial newline when hr first element 2023-04-29 14:21:11 +02:00