Current section
34 Versions
Jump to
Current section
34 Versions
Compare versions
5
files changed
+69
additions
-99
deletions
| @@ -1,5 +1,5 @@ | |
| 1 1 | name = "jot" |
| 2 | - version = "10.1.0" |
| 2 | + version = "10.1.1" |
| 3 3 | gleam = ">= 1.14.0" |
| 4 4 | description = "A parser for Djot, a markdown-like language" |
| 5 5 | licences = ["Apache-2.0"] |
| @@ -1,6 +1,6 @@ | |
| 1 1 | {<<"name">>, <<"jot">>}. |
| 2 2 | {<<"app">>, <<"jot">>}. |
| 3 | - {<<"version">>, <<"10.1.0">>}. |
| 3 | + {<<"version">>, <<"10.1.1">>}. |
| 4 4 | {<<"description">>, <<"A parser for Djot, a markdown-like language"/utf8>>}. |
| 5 5 | {<<"licenses">>, [<<"Apache-2.0">>]}. |
| 6 6 | {<<"build_tools">>, [<<"gleam">>]}. |
| @@ -1,5 +1,5 @@ | |
| 1 1 | {application, jot, [ |
| 2 | - {vsn, "10.1.0"}, |
| 2 | + {vsn, "10.1.1"}, |
| 3 3 | {applications, [gleam_stdlib, |
| 4 4 | houdini, |
| 5 5 | splitter]}, |
| @@ -590,24 +590,6 @@ parse_attributes_id_or_class(In, Id) -> | |
| 590 590 | end |
| 591 591 | end. |
| 592 592 | |
| 593 | - -file("src/jot.gleam", 987). |
| 594 | - -spec parse_attributes_end(binary(), gleam@dict:dict(binary(), binary())) -> gleam@option:option({gleam@dict:dict(binary(), binary()), |
| 595 | - binary()}). |
| 596 | - parse_attributes_end(In, Attrs) -> |
| 597 | - case In of |
| 598 | - <<""/utf8>> -> |
| 599 | - {some, {Attrs, <<""/utf8>>}}; |
| 600 | - |
| 601 | - <<"\n"/utf8, In@1/binary>> -> |
| 602 | - {some, {Attrs, In@1}}; |
| 603 | - |
| 604 | - <<" "/utf8, In@2/binary>> -> |
| 605 | - parse_attributes_end(In@2, Attrs); |
| 606 | - |
| 607 | - _ -> |
| 608 | - {some, {Attrs, In}} |
| 609 | - end. |
| 610 | - |
| 611 593 | -file("src/jot.gleam", 895). |
| 612 594 | -spec parse_attributes(binary(), gleam@dict:dict(binary(), binary())) -> gleam@option:option({gleam@dict:dict(binary(), binary()), |
| 613 595 | binary()}). |
| @@ -618,7 +600,7 @@ parse_attributes(In, Attrs) -> | |
| 618 600 | none; |
| 619 601 | |
| 620 602 | <<"}"/utf8, In@2/binary>> -> |
| 621 | - parse_attributes_end(In@2, Attrs); |
| 603 | + {some, {Attrs, In@2}}; |
| 622 604 | |
| 623 605 | <<"#"/utf8, In@3/binary>> -> |
| 624 606 | case parse_attributes_id_or_class(In@3, <<""/utf8>>) of |
| @@ -654,7 +636,7 @@ parse_attributes(In, Attrs) -> | |
| 654 636 | end |
| 655 637 | end. |
| 656 638 | |
| 657 | - -file("src/jot.gleam", 1140). |
| 639 | + -file("src/jot.gleam", 1128). |
| 658 640 | -spec id_sanitise(binary()) -> binary(). |
| 659 641 | id_sanitise(Content) -> |
| 660 642 | _pipe = Content, |
| @@ -666,7 +648,7 @@ id_sanitise(Content) -> | |
| 666 648 | _pipe@6 = gleam@string:replace(_pipe@5, <<" "/utf8>>, <<"-"/utf8>>), |
| 667 649 | gleam@string:replace(_pipe@6, <<"\n"/utf8>>, <<"-"/utf8>>). |
| 668 650 | |
| 669 | - -file("src/jot.gleam", 1169). |
| 651 | + -file("src/jot.gleam", 1157). |
| 670 652 | -spec take_heading_chars_newline_hash(binary(), integer(), binary()) -> gleam@option:option({binary(), |
| 671 653 | binary()}). |
| 672 654 | take_heading_chars_newline_hash(In, Level, Acc) -> |
| @@ -690,7 +672,7 @@ take_heading_chars_newline_hash(In, Level, Acc) -> | |
| 690 672 | none |
| 691 673 | end. |
| 692 674 | |
| 693 | - -file("src/jot.gleam", 1151). |
| 675 | + -file("src/jot.gleam", 1139). |
| 694 676 | -spec take_heading_chars(binary(), integer(), binary()) -> {binary(), binary()}. |
| 695 677 | take_heading_chars(In, Level, Acc) -> |
| 696 678 | case In of |
| @@ -726,7 +708,7 @@ take_heading_chars(In, Level, Acc) -> | |
| 726 708 | end |
| 727 709 | end. |
| 728 710 | |
| 729 | - -file("src/jot.gleam", 1420). |
| 711 | + -file("src/jot.gleam", 1408). |
| 730 712 | -spec parse_autolink(binary()) -> gleam@option:option({inline(), binary()}). |
| 731 713 | parse_autolink(In) -> |
| 732 714 | case gleam@string:split_once(In, <<">"/utf8>>) of |
| @@ -754,7 +736,7 @@ parse_autolink(In) -> | |
| 754 736 | end |
| 755 737 | end. |
| 756 738 | |
| 757 | - -file("src/jot.gleam", 1455). |
| 739 | + -file("src/jot.gleam", 1443). |
| 758 740 | -spec take_symbol_chars(binary(), binary()) -> gleam@option:option({binary(), |
| 759 741 | binary()}). |
| 760 742 | take_symbol_chars(In, Acc) -> |
| @@ -1032,7 +1014,7 @@ take_symbol_chars(In, Acc) -> | |
| 1032 1014 | none |
| 1033 1015 | end. |
| 1034 1016 | |
| 1035 | - -file("src/jot.gleam", 1443). |
| 1017 | + -file("src/jot.gleam", 1431). |
| 1036 1018 | -spec parse_symbol(binary()) -> gleam@option:option({inline(), binary()}). |
| 1037 1019 | parse_symbol(In) -> |
| 1038 1020 | case take_symbol_chars(In, <<""/utf8>>) of |
| @@ -1043,7 +1025,7 @@ parse_symbol(In) -> | |
| 1043 1025 | none |
| 1044 1026 | end. |
| 1045 1027 | |
| 1046 | - -file("src/jot.gleam", 1529). |
| 1028 | + -file("src/jot.gleam", 1517). |
| 1047 1029 | -spec parse_math(binary(), splitters(), boolean()) -> gleam@option:option({inline(), |
| 1048 1030 | binary()}). |
| 1049 1031 | parse_math(In, Splitters, Display) -> |
| @@ -1062,7 +1044,7 @@ parse_math(In, Splitters, Display) -> | |
| 1062 1044 | {some, {Math, Rest}} |
| 1063 1045 | end. |
| 1064 1046 | |
| 1065 | - -file("src/jot.gleam", 1592). |
| 1047 | + -file("src/jot.gleam", 1580). |
| 1066 1048 | -spec parse_code_end(binary(), integer(), integer(), binary()) -> {boolean(), |
| 1067 1049 | binary(), |
| 1068 1050 | binary()}. |
| @@ -1084,7 +1066,7 @@ parse_code_end(In, Limit, Count, Content) -> | |
| 1084 1066 | In} |
| 1085 1067 | end. |
| 1086 1068 | |
| 1087 | - -file("src/jot.gleam", 1569). |
| 1069 | + -file("src/jot.gleam", 1557). |
| 1088 1070 | -spec parse_code_content(binary(), integer(), binary()) -> {binary(), binary()}. |
| 1089 1071 | parse_code_content(In, Count, Content) -> |
| 1090 1072 | case In of |
| @@ -1115,7 +1097,7 @@ parse_code_content(In, Count, Content) -> | |
| 1115 1097 | end |
| 1116 1098 | end. |
| 1117 1099 | |
| 1118 | - -file("src/jot.gleam", 1547). |
| 1100 | + -file("src/jot.gleam", 1535). |
| 1119 1101 | -spec parse_code(binary(), integer()) -> {inline(), binary()}. |
| 1120 1102 | parse_code(In, Count) -> |
| 1121 1103 | case In of |
| @@ -1147,7 +1129,7 @@ parse_code(In, Count) -> | |
| 1147 1129 | {{code, Content@2}, In@2} |
| 1148 1130 | end. |
| 1149 1131 | |
| 1150 | - -file("src/jot.gleam", 1622). |
| 1132 | + -file("src/jot.gleam", 1610). |
| 1151 1133 | -spec take_emphasis_chars(binary(), binary(), binary()) -> gleam@option:option({binary(), |
| 1152 1134 | binary()}). |
| 1153 1135 | take_emphasis_chars(In, Close, Acc) -> |
| @@ -1216,7 +1198,7 @@ take_emphasis_chars(In, Close, Acc) -> | |
| 1216 1198 | end |
| 1217 1199 | end. |
| 1218 1200 | |
| 1219 | - -file("src/jot.gleam", 1683). |
| 1201 | + -file("src/jot.gleam", 1671). |
| 1220 1202 | -spec consume_until_space_or_newline(binary(), binary()) -> {binary(), binary()}. |
| 1221 1203 | consume_until_space_or_newline(In, Acc) -> |
| 1222 1204 | case In of |
| @@ -1242,7 +1224,7 @@ consume_until_space_or_newline(In, Acc) -> | |
| 1242 1224 | end |
| 1243 1225 | end. |
| 1244 1226 | |
| 1245 | - -file("src/jot.gleam", 1822). |
| 1227 | + -file("src/jot.gleam", 1810). |
| 1246 1228 | -spec take_link_chars_destination( |
| 1247 1229 | binary(), |
| 1248 1230 | boolean(), |
| @@ -1280,7 +1262,7 @@ take_link_chars_destination(In, Is_url, Inline_in, Splitters, Acc) -> | |
| 1280 1262 | none |
| 1281 1263 | end. |
| 1282 1264 | |
| 1283 | - -file("src/jot.gleam", 1751). |
| 1265 | + -file("src/jot.gleam", 1739). |
| 1284 1266 | -spec take_link_chars_or_span_depth(binary(), binary(), splitters(), integer()) -> gleam@option:option({binary(), |
| 1285 1267 | gleam@option:option(destination()), |
| 1286 1268 | binary()}). |
| @@ -1364,14 +1346,14 @@ take_link_chars_or_span_depth(In, Inline_in, Splitters, Depth) -> | |
| 1364 1346 | end |
| 1365 1347 | end. |
| 1366 1348 | |
| 1367 | - -file("src/jot.gleam", 1743). |
| 1349 | + -file("src/jot.gleam", 1731). |
| 1368 1350 | -spec take_link_chars_or_span(binary(), binary(), splitters()) -> gleam@option:option({binary(), |
| 1369 1351 | gleam@option:option(destination()), |
| 1370 1352 | binary()}). |
| 1371 1353 | take_link_chars_or_span(In, Inline_in, Splitters) -> |
| 1372 1354 | take_link_chars_or_span_depth(In, Inline_in, Splitters, 0). |
| 1373 1355 | |
| 1374 | - -file("src/jot.gleam", 1848). |
| 1356 | + -file("src/jot.gleam", 1836). |
| 1375 1357 | -spec parse_footnote(binary(), binary()) -> gleam@option:option({inline(), |
| 1376 1358 | binary()}). |
| 1377 1359 | parse_footnote(In, Acc) -> |
| @@ -1392,7 +1374,7 @@ parse_footnote(In, Acc) -> | |
| 1392 1374 | end |
| 1393 1375 | end. |
| 1394 1376 | |
| 1395 | - -file("src/jot.gleam", 1865). |
| 1377 | + -file("src/jot.gleam", 1853). |
| 1396 1378 | -spec heading_level(binary(), integer()) -> gleam@option:option({integer(), |
| 1397 1379 | binary()}). |
| 1398 1380 | heading_level(In, Level) -> |
| @@ -1413,7 +1395,7 @@ heading_level(In, Level) -> | |
| 1413 1395 | none |
| 1414 1396 | end. |
| 1415 1397 | |
| 1416 | - -file("src/jot.gleam", 1876). |
| 1398 | + -file("src/jot.gleam", 1864). |
| 1417 1399 | -spec take_inline_text(list(inline()), binary()) -> binary(). |
| 1418 1400 | take_inline_text(Inlines, Acc) -> |
| 1419 1401 | case Inlines of |
| @@ -1475,7 +1457,7 @@ take_inline_text(Inlines, Acc) -> | |
| 1475 1457 | end |
| 1476 1458 | end. |
| 1477 1459 | |
| 1478 | - -file("src/jot.gleam", 2166). |
| 1460 | + -file("src/jot.gleam", 2154). |
| 1479 1461 | -spec drop_n_spaces(binary(), integer()) -> binary(). |
| 1480 1462 | drop_n_spaces(In, Count) -> |
| 1481 1463 | case In of |
| @@ -1489,7 +1471,7 @@ drop_n_spaces(In, Count) -> | |
| 1489 1471 | In |
| 1490 1472 | end. |
| 1491 1473 | |
| 1492 | - -file("src/jot.gleam", 2174). |
| 1474 | + -file("src/jot.gleam", 2162). |
| 1493 1475 | -spec parse_number_list(binary(), integer(), boolean()) -> gleam@option:option({ordinal_punctuation(), |
| 1494 1476 | ordinal_style(), |
| 1495 1477 | integer(), |
| @@ -1556,7 +1538,7 @@ parse_number_list(In, Num, Paren) -> | |
| 1556 1538 | none |
| 1557 1539 | end. |
| 1558 1540 | |
| 1559 | - -file("src/jot.gleam", 2203). |
| 1541 | + -file("src/jot.gleam", 2191). |
| 1560 1542 | -spec parse_lower_list(binary(), integer(), boolean()) -> gleam@option:option({ordinal_punctuation(), |
| 1561 1543 | ordinal_style(), |
| 1562 1544 | integer(), |
| @@ -1671,7 +1653,7 @@ parse_lower_list(In, Num, Paren) -> | |
| 1671 1653 | none |
| 1672 1654 | end. |
| 1673 1655 | |
| 1674 | - -file("src/jot.gleam", 2251). |
| 1656 | + -file("src/jot.gleam", 2239). |
| 1675 1657 | -spec parse_upper_list(binary(), integer(), boolean()) -> gleam@option:option({ordinal_punctuation(), |
| 1676 1658 | ordinal_style(), |
| 1677 1659 | integer(), |
| @@ -1786,7 +1768,7 @@ parse_upper_list(In, Num, Paren) -> | |
| 1786 1768 | none |
| 1787 1769 | end. |
| 1788 1770 | |
| 1789 | - -file("src/jot.gleam", 2017). |
| 1771 | + -file("src/jot.gleam", 2005). |
| 1790 1772 | -spec parse_list_marker_maybe_paren(binary(), boolean()) -> gleam@option:option({list_style(), |
| 1791 1773 | binary()}). |
| 1792 1774 | parse_list_marker_maybe_paren(In, Paren) -> |
| @@ -2353,7 +2335,7 @@ parse_list_marker_maybe_paren(In, Paren) -> | |
| 2353 2335 | none |
| 2354 2336 | end. |
| 2355 2337 | |
| 2356 | - -file("src/jot.gleam", 2007). |
| 2338 | + -file("src/jot.gleam", 1995). |
| 2357 2339 | -spec parse_list_marker(binary()) -> gleam@option:option({list_style(), |
| 2358 2340 | binary()}). |
| 2359 2341 | parse_list_marker(In) -> |
| @@ -2383,7 +2365,7 @@ parse_list_marker(In) -> | |
| 2383 2365 | parse_list_marker_maybe_paren(In, false) |
| 2384 2366 | end. |
| 2385 2367 | |
| 2386 | - -file("src/jot.gleam", 2150). |
| 2368 | + -file("src/jot.gleam", 2138). |
| 2387 2369 | -spec continue_list(binary(), list_style()) -> gleam@option:option(binary()). |
| 2388 2370 | continue_list(In, Style) -> |
| 2389 2371 | case parse_list_marker(In) of |
| @@ -2403,7 +2385,7 @@ continue_list(In, Style) -> | |
| 2403 2385 | none |
| 2404 2386 | end. |
| 2405 2387 | |
| 2406 | - -file("src/jot.gleam", 2106). |
| 2388 | + -file("src/jot.gleam", 2094). |
| 2407 2389 | -spec take_list_item_chars_indented( |
| 2408 2390 | binary(), |
| 2409 2391 | binary(), |
| @@ -2465,7 +2447,7 @@ take_list_item_chars_indented(In, Acc, Style, Layout, Indent) -> | |
| 2465 2447 | end |
| 2466 2448 | end. |
| 2467 2449 | |
| 2468 | - -file("src/jot.gleam", 1960). |
| 2450 | + -file("src/jot.gleam", 1948). |
| 2469 2451 | -spec take_list_item_chars(binary(), binary(), list_style(), list_layout()) -> {binary(), |
| 2470 2452 | binary(), |
| 2471 2453 | list_layout()}. |
| @@ -2533,7 +2515,7 @@ take_list_item_chars(In, Acc, Style, Layout) -> | |
| 2533 2515 | end |
| 2534 2516 | end. |
| 2535 2517 | |
| 2536 | - -file("src/jot.gleam", 2349). |
| 2518 | + -file("src/jot.gleam", 2337). |
| 2537 2519 | ?DOC( |
| 2538 2520 | " Split at \\n. If a newline is not present, then the remaining characters\n" |
| 2539 2521 | " will be returned as if there where a newline as the final character.\n" |
| @@ -2588,7 +2570,7 @@ parse_div_class(In) -> | |
| 2588 2570 | none |
| 2589 2571 | end. |
| 2590 2572 | |
| 2591 | - -file("src/jot.gleam", 2330). |
| 2573 | + -file("src/jot.gleam", 2318). |
| 2592 2574 | ?DOC( |
| 2593 2575 | " Search a stretch of paragraph characters for valid div terminator. A valid\n" |
| 2594 2576 | " div terminator is a line containing leading and trailing whitespace with an\n" |
| @@ -2622,7 +2604,7 @@ search_paragraph_for_div_end(In, Acc, Size) -> | |
| 2622 2604 | end |
| 2623 2605 | end. |
| 2624 2606 | |
| 2625 | - -file("src/jot.gleam", 2299). |
| 2607 | + -file("src/jot.gleam", 2287). |
| 2626 2608 | -spec take_paragraph_chars(binary(), gleam@option:option(integer())) -> {binary(), |
| 2627 2609 | binary()}. |
| 2628 2610 | take_paragraph_chars(In, Div_close_size) -> |
| @@ -2663,7 +2645,7 @@ take_paragraph_chars(In, Div_close_size) -> | |
| 2663 2645 | {Paragraph, In@2} |
| 2664 2646 | end. |
| 2665 2647 | |
| 2666 | - -file("src/jot.gleam", 2611). |
| 2648 | + -file("src/jot.gleam", 2599). |
| 2667 2649 | -spec get_new_footnotes( |
| 2668 2650 | generated_html(), |
| 2669 2651 | generated_html(), |
| @@ -2685,14 +2667,14 @@ get_new_footnotes(Original_html, New_html, Acc) -> | |
| 2685 2667 | Acc |
| 2686 2668 | end. |
| 2687 2669 | |
| 2688 | - -file("src/jot.gleam", 2628). |
| 2670 | + -file("src/jot.gleam", 2616). |
| 2689 2671 | -spec append_to_html(generated_html(), binary()) -> generated_html(). |
| 2690 2672 | append_to_html(Original_html, Str) -> |
| 2691 2673 | {generated_html, |
| 2692 2674 | <<(erlang:element(2, Original_html))/binary, Str/binary>>, |
| 2693 2675 | erlang:element(3, Original_html)}. |
| 2694 2676 | |
| 2695 | - -file("src/jot.gleam", 2658). |
| 2677 | + -file("src/jot.gleam", 2646). |
| 2696 2678 | -spec close_tag(generated_html(), binary()) -> generated_html(). |
| 2697 2679 | close_tag(Initial_html, Tag) -> |
| 2698 2680 | {generated_html, |
| @@ -2701,7 +2683,7 @@ close_tag(Initial_html, Tag) -> | |
| 2701 2683 | ">"/utf8>>, |
| 2702 2684 | erlang:element(3, Initial_html)}. |
| 2703 2685 | |
| 2704 | - -file("src/jot.gleam", 2876). |
| 2686 | + -file("src/jot.gleam", 2864). |
| 2705 2687 | -spec find_footnote_number( |
| 2706 2688 | list({integer(), binary()}), |
| 2707 2689 | binary(), |
| @@ -2730,7 +2712,7 @@ find_footnote_number(Footnotes_to_check, Reference, Used_footnotes) -> | |
| 2730 2712 | find_footnote_number(Rest, Reference, Used_footnotes) |
| 2731 2713 | end. |
| 2732 2714 | |
| 2733 | - -file("src/jot.gleam", 2904). |
| 2715 | + -file("src/jot.gleam", 2892). |
| 2734 2716 | -spec get_reference_attributes(destination(), render_refs()) -> gleam@dict:dict(binary(), binary()). |
| 2735 2717 | get_reference_attributes(Destination, Refs) -> |
| 2736 2718 | case Destination of |
| @@ -2742,7 +2724,7 @@ get_reference_attributes(Destination, Refs) -> | |
| 2742 2724 | gleam@result:unwrap(_pipe, maps:new()) |
| 2743 2725 | end. |
| 2744 2726 | |
| 2745 | - -file("src/jot.gleam", 2916). |
| 2727 | + -file("src/jot.gleam", 2904). |
| 2746 2728 | -spec destination_attribute(binary(), destination(), render_refs()) -> gleam@dict:dict(binary(), binary()). |
| 2747 2729 | destination_attribute(Key, Destination, Refs) -> |
| 2748 2730 | Dict = maps:new(), |
| @@ -2760,7 +2742,7 @@ destination_attribute(Key, Destination, Refs) -> | |
| 2760 2742 | end |
| 2761 2743 | end. |
| 2762 2744 | |
| 2763 | - -file("src/jot.gleam", 2939). |
| 2745 | + -file("src/jot.gleam", 2927). |
| 2764 2746 | -spec ordered_attributes_to_html(list({binary(), binary()}), binary()) -> binary(). |
| 2765 2747 | ordered_attributes_to_html(Attributes, Html) -> |
| 2766 2748 | gleam@list:fold( |
| @@ -2775,7 +2757,7 @@ ordered_attributes_to_html(Attributes, Html) -> | |
| 2775 2757 | end |
| 2776 2758 | ). |
| 2777 2759 | |
| 2778 | - -file("src/jot.gleam", 2646). |
| 2760 | + -file("src/jot.gleam", 2634). |
| 2779 2761 | -spec open_tag_ordered_attributes( |
| 2780 2762 | generated_html(), |
| 2781 2763 | binary(), |
| @@ -2788,7 +2770,7 @@ open_tag_ordered_attributes(Initial_html, Tag, Attributes) -> | |
| 2788 2770 | <<(ordered_attributes_to_html(Attributes, Html))/binary, ">"/utf8>>, |
| 2789 2771 | erlang:element(3, Initial_html)}. |
| 2790 2772 | |
| 2791 | - -file("src/jot.gleam", 2601). |
| 2773 | + -file("src/jot.gleam", 2589). |
| 2792 2774 | -spec add_footnote_link(generated_html(), binary()) -> generated_html(). |
| 2793 2775 | add_footnote_link(Html, Footnote_number) -> |
| 2794 2776 | _pipe = Html, |
| @@ -2801,7 +2783,7 @@ add_footnote_link(Html, Footnote_number) -> | |
| 2801 2783 | _pipe@2 = append_to_html(_pipe@1, <<"↩︎"/utf8>>), |
| 2802 2784 | close_tag(_pipe@2, <<"a"/utf8>>). |
| 2803 2785 | |
| 2804 | - -file("src/jot.gleam", 2932). |
| 2786 | + -file("src/jot.gleam", 2920). |
| 2805 2787 | -spec attributes_to_html(binary(), gleam@dict:dict(binary(), binary())) -> binary(). |
| 2806 2788 | attributes_to_html(Html, Attributes) -> |
| 2807 2789 | _pipe = Attributes, |
| @@ -2814,7 +2796,7 @@ attributes_to_html(Html, Attributes) -> | |
| 2814 2796 | ), |
| 2815 2797 | ordered_attributes_to_html(_pipe@2, Html). |
| 2816 2798 | |
| 2817 | - -file("src/jot.gleam", 2632). |
| 2799 | + -file("src/jot.gleam", 2620). |
| 2818 2800 | -spec open_tag(generated_html(), binary(), gleam@dict:dict(binary(), binary())) -> generated_html(). |
| 2819 2801 | open_tag(Initial_html, Tag, Attributes) -> |
| 2820 2802 | Html = <<<<(erlang:element(2, Initial_html))/binary, "<"/utf8>>/binary, |
| @@ -2823,7 +2805,7 @@ open_tag(Initial_html, Tag, Attributes) -> | |
| 2823 2805 | <<(attributes_to_html(Html, Attributes))/binary, ">"/utf8>>, |
| 2824 2806 | erlang:element(3, Initial_html)}. |
| 2825 2807 | |
| 2826 | - -file("src/jot.gleam", 2970). |
| 2808 | + -file("src/jot.gleam", 2958). |
| 2827 2809 | -spec inline_text(binary(), inline()) -> binary(). |
| 2828 2810 | inline_text(Accumulator, Item) -> |
| 2829 2811 | case Item of |
| @@ -2876,7 +2858,7 @@ inline_text(Accumulator, Item) -> | |
| 2876 2858 | gleam@list:fold(Content@1, Accumulator, fun inline_text/2) |
| 2877 2859 | end. |
| 2878 2860 | |
| 2879 | - -file("src/jot.gleam", 2953). |
| 2861 | + -file("src/jot.gleam", 2941). |
| 2880 2862 | ?DOC( |
| 2881 2863 | " Get the text from within a container.\n" |
| 2882 2864 | "\n" |
| @@ -2926,7 +2908,7 @@ inner_text(Container) -> | |
| 2926 2908 | gleam@string:join(_pipe@2, <<"\n\n"/utf8>>) |
| 2927 2909 | end. |
| 2928 2910 | |
| 2929 | - -file("src/jot.gleam", 2462). |
| 2911 | + -file("src/jot.gleam", 2450). |
| 2930 2912 | -spec container_to_html(generated_html(), container(), render_refs()) -> generated_html(). |
| 2931 2913 | container_to_html(Html, Container, Refs) -> |
| 2932 2914 | New_html = case Container of |
| @@ -3020,7 +3002,7 @@ container_to_html(Html, Container, Refs) -> | |
| 3020 3002 | end, |
| 3021 3003 | append_to_html(New_html, <<"\n"/utf8>>). |
| 3022 3004 | |
| 3023 | - -file("src/jot.gleam", 2667). |
| 3005 | + -file("src/jot.gleam", 2655). |
| 3024 3006 | -spec list_items_to_html( |
| 3025 3007 | generated_html(), |
| 3026 3008 | list_layout(), |
| @@ -3067,7 +3049,7 @@ list_items_to_html(Html, Layout, Items, Refs) -> | |
| 3067 3049 | list_items_to_html(_pipe@20, Layout, Rest@2, Refs) |
| 3068 3050 | end. |
| 3069 3051 | |
| 3070 | - -file("src/jot.gleam", 2448). |
| 3052 | + -file("src/jot.gleam", 2436). |
| 3071 3053 | -spec containers_to_html(list(container()), render_refs(), generated_html()) -> generated_html(). |
| 3072 3054 | containers_to_html(Containers, Refs, Html) -> |
| 3073 3055 | case Containers of |
| @@ -3079,7 +3061,7 @@ containers_to_html(Containers, Refs, Html) -> | |
| 3079 3061 | containers_to_html(Rest, Refs, Html@1) |
| 3080 3062 | end. |
| 3081 3063 | |
| 3082 | - -file("src/jot.gleam", 2735). |
| 3064 | + -file("src/jot.gleam", 2723). |
| 3083 3065 | -spec inline_to_html(generated_html(), inline(), render_refs(), trim()) -> generated_html(). |
| 3084 3066 | inline_to_html(Html, Inline, Refs, Trim) -> |
| 3085 3067 | case Inline of |
| @@ -3239,7 +3221,7 @@ inline_to_html(Html, Inline, Refs, Trim) -> | |
| 3239 3221 | New_used_footnotes} |
| 3240 3222 | end. |
| 3241 3223 | |
| 3242 | - -file("src/jot.gleam", 2713). |
| 3224 | + -file("src/jot.gleam", 2701). |
| 3243 3225 | -spec inlines_to_html(generated_html(), list(inline()), render_refs(), trim()) -> generated_html(). |
| 3244 3226 | inlines_to_html(Html, Inlines, Refs, Trim) -> |
| 3245 3227 | case Inlines of |
| @@ -3256,7 +3238,7 @@ inlines_to_html(Html, Inlines, Refs, Trim) -> | |
| 3256 3238 | inlines_to_html(_pipe@2, Rest, Refs, Trim) |
| 3257 3239 | end. |
| 3258 3240 | |
| 3259 | - -file("src/jot.gleam", 2418). |
| 3241 | + -file("src/jot.gleam", 2406). |
| 3260 3242 | -spec containers_to_html_with_last_paragraph( |
| 3261 3243 | list(container()), |
| 3262 3244 | render_refs(), |
| @@ -3289,7 +3271,7 @@ containers_to_html_with_last_paragraph(Containers, Refs, Html, Apply) -> | |
| 3289 3271 | containers_to_html_with_last_paragraph(Rest, Refs, Html@1, Apply) |
| 3290 3272 | end. |
| 3291 3273 | |
| 3292 | - -file("src/jot.gleam", 2542). |
| 3274 | + -file("src/jot.gleam", 2530). |
| 3293 3275 | -spec create_footnotes( |
| 3294 3276 | document(), |
| 3295 3277 | list({integer(), binary()}), |
| @@ -3362,7 +3344,7 @@ create_footnotes(Document, Used_footnotes, Html_acc) -> | |
| 3362 3344 | create_footnotes(Document, New_used_footnotes, Html@1) |
| 3363 3345 | end. |
| 3364 3346 | |
| 3365 | - -file("src/jot.gleam", 2368). |
| 3347 | + -file("src/jot.gleam", 2356). |
| 3366 3348 | ?DOC( |
| 3367 3349 | " Convert a document tree into a string of HTML.\n" |
| 3368 3350 | "\n" |
| @@ -4183,7 +4165,7 @@ parse_div(In, Refs, Attrs, Splitters) -> | |
| 4183 4165 | end |
| 4184 4166 | ). |
| 4185 4167 | |
| 4186 | - -file("src/jot.gleam", 1070). |
| 4168 | + -file("src/jot.gleam", 1058). |
| 4187 4169 | -spec parse_block_quote_items( |
| 4188 4170 | binary(), |
| 4189 4171 | refs(), |
| @@ -4221,7 +4203,7 @@ parse_block_quote_items(In, Refs, Attrs, Splitters, Children) -> | |
| 4221 4203 | ) |
| 4222 4204 | end. |
| 4223 4205 | |
| 4224 | - -file("src/jot.gleam", 1941). |
| 4206 | + -file("src/jot.gleam", 1929). |
| 4225 4207 | -spec parse_list_item( |
| 4226 4208 | binary(), |
| 4227 4209 | refs(), |
| @@ -4253,7 +4235,7 @@ parse_list_item(In, Refs, Attrs, Splitters, Children) -> | |
| 4253 4235 | parse_list_item(In@1, Refs@1, Attrs@1, Splitters, Children@1) |
| 4254 4236 | end. |
| 4255 4237 | |
| 4256 | - -file("src/jot.gleam", 1915). |
| 4238 | + -file("src/jot.gleam", 1903). |
| 4257 4239 | -spec parse_list( |
| 4258 4240 | binary(), |
| 4259 4241 | refs(), |
| @@ -5485,7 +5467,7 @@ parse_maybe_list(In, Refs, Attrs, Splitters, Paren) -> | |
| 5485 5467 | none |
| 5486 5468 | end. |
| 5487 5469 | |
| 5488 | - -file("src/jot.gleam", 1606). |
| 5470 | + -file("src/jot.gleam", 1594). |
| 5489 5471 | -spec parse_emphasis(binary(), splitters(), binary()) -> gleam@option:option({list(inline()), |
| 5490 5472 | binary()}). |
| 5491 5473 | parse_emphasis(In, Splitters, Close) -> |
| @@ -5503,7 +5485,7 @@ parse_emphasis(In, Splitters, Close) -> | |
| 5503 5485 | {some, {Inline, <<Inline_in_remaining/binary, In@1/binary>>}} |
| 5504 5486 | end. |
| 5505 5487 | |
| 5506 | - -file("src/jot.gleam", 1187). |
| 5488 | + -file("src/jot.gleam", 1175). |
| 5507 5489 | -spec parse_inline(binary(), splitters(), binary(), list(inline())) -> {list(inline()), |
| 5508 5490 | binary()}. |
| 5509 5491 | parse_inline(In, Splitters, Text, Acc) -> |
| @@ -6218,7 +6200,7 @@ parse_inline(In, Splitters, Text, Acc) -> | |
| 6218 6200 | end |
| 6219 6201 | end. |
| 6220 6202 | |
| 6221 | - -file("src/jot.gleam", 1651). |
| 6203 | + -file("src/jot.gleam", 1639). |
| 6222 6204 | -spec parse_insert_delete_mark(binary(), splitters(), binary()) -> gleam@option:option({list(inline()), |
| 6223 6205 | binary()}). |
| 6224 6206 | parse_insert_delete_mark(In, Splitters, Close) -> |
| @@ -6236,7 +6218,7 @@ parse_insert_delete_mark(In, Splitters, Close) -> | |
| 6236 6218 | {some, {Inline, <<Inline_in_remaining/binary, Rest/binary>>}} |
| 6237 6219 | end. |
| 6238 6220 | |
| 6239 | - -file("src/jot.gleam", 1696). |
| 6221 | + -file("src/jot.gleam", 1684). |
| 6240 6222 | -spec parse_link( |
| 6241 6223 | binary(), |
| 6242 6224 | splitters(), |
| @@ -6302,7 +6284,7 @@ parse_link(In, Splitters, To_inline) -> | |
| 6302 6284 | <<Inline_in_remaining@1/binary, In@5/binary>>}} |
| 6303 6285 | end. |
| 6304 6286 | |
| 6305 | - -file("src/jot.gleam", 1666). |
| 6287 | + -file("src/jot.gleam", 1654). |
| 6306 6288 | -spec parse_link_or_recover( |
| 6307 6289 | binary(), |
| 6308 6290 | splitters(), |
| @@ -6322,7 +6304,7 @@ parse_link_or_recover(In, Splitters, To_inline, Opening) -> | |
| 6322 6304 | {error, {<<Opening/binary, Consumed/binary>>, Remaining@1}} |
| 6323 6305 | end. |
| 6324 6306 | |
| 6325 | - -file("src/jot.gleam", 1903). |
| 6307 | + -file("src/jot.gleam", 1891). |
| 6326 6308 | -spec parse_paragraph( |
| 6327 6309 | binary(), |
| 6328 6310 | gleam@dict:dict(binary(), binary()), |
| @@ -6339,7 +6321,7 @@ parse_paragraph(In, Attrs, Splitters, Div_close_size) -> | |
| 6339 6321 | ), |
| 6340 6322 | {{paragraph, Attrs, Inline}, <<Inline_in_remaining/binary, In@1/binary>>}. |
| 6341 6323 | |
| 6342 | - -file("src/jot.gleam", 1089). |
| 6324 | + -file("src/jot.gleam", 1077). |
| 6343 6325 | -spec parse_heading( |
| 6344 6326 | binary(), |
| 6345 6327 | refs(), |
| @@ -6408,7 +6390,7 @@ parse_heading(In, Refs, Splitters, Attrs, Div_close_size) -> | |
| 6408 6390 | {P, Refs, In@4} |
| 6409 6391 | end. |
| 6410 6392 | |
| 6411 | - -file("src/jot.gleam", 1045). |
| 6393 | + -file("src/jot.gleam", 1033). |
| 6412 6394 | -spec take_block_quote_stop_on_div_close( |
| 6413 6395 | binary(), |
| 6414 6396 | list(binary()), |
| @@ -6446,7 +6428,7 @@ take_block_quote_stop_on_div_close(In, Lines, Div_close_size) -> | |
| 6446 6428 | end |
| 6447 6429 | end. |
| 6448 6430 | |
| 6449 | - -file("src/jot.gleam", 1018). |
| 6431 | + -file("src/jot.gleam", 1006). |
| 6450 6432 | -spec take_block_quote_chars( |
| 6451 6433 | binary(), |
| 6452 6434 | list(binary()), |
| @@ -6486,7 +6468,7 @@ take_block_quote_chars(In, Lines, Div_close_size) -> | |
| 6486 6468 | take_block_quote_stop_on_div_close(In@5, Lines, Div_close_size) |
| 6487 6469 | end. |
| 6488 6470 | |
| 6489 | - -file("src/jot.gleam", 999). |
| 6471 | + -file("src/jot.gleam", 987). |
| 6490 6472 | -spec parse_block_quote( |
| 6491 6473 | binary(), |
| 6492 6474 | refs(), |
| @@ -899,7 +899,7 @@ fn parse_attributes( | |
| 899 899 | let in = drop_spaces(in) |
| 900 900 | case in { |
| 901 901 | "" -> None |
| 902 | - "}" <> in -> parse_attributes_end(in, attrs) |
| 902 | + "}" <> in -> Some(#(attrs, in)) |
| 903 903 | "#" <> in -> { |
| 904 904 | case parse_attributes_id_or_class(in, "") { |
| 905 905 | Some(#(id, in)) -> parse_attributes(in, add_attribute(attrs, "id", id)) |
| @@ -984,18 +984,6 @@ fn parse_attributes_id_or_class( | |
| 984 984 | } |
| 985 985 | } |
| 986 986 | |
| 987 | - fn parse_attributes_end( |
| 988 | - in: String, |
| 989 | - attrs: Dict(String, String), |
| 990 | - ) -> Option(#(Dict(String, String), String)) { |
| 991 | - case in { |
| 992 | - "" -> Some(#(attrs, "")) |
| 993 | - "\n" <> in -> Some(#(attrs, in)) |
| 994 | - " " <> in -> parse_attributes_end(in, attrs) |
| 995 | - _ -> Some(#(attrs, in)) |
| 996 | - } |
| 997 | - } |
| 998 | - |
| 999 987 | fn parse_block_quote( |
| 1000 988 | in: String, |
| 1001 989 | refs: Refs, |