|
1 | 1 | %%% % DO NOT EDIT: this file was generated by 'just codegen' |
2 | | -%%% % @generated SignedSource<<d765ec1870e25364c6d9bc74e10939ab>> |
| 2 | +%%% % @generated SignedSource<<1be490fcba975f57ac66c486642172f8>> |
3 | 3 | %%%----------------------------------------------------------------------------- |
4 | 4 | %%% %CopyrightBegin% |
5 | 5 | %%% |
|
74 | 74 | test_mdx_expression_flow_case_20/1, |
75 | 75 | test_mdx_expression_flow_case_21/1, |
76 | 76 | test_mdx_expression_flow_case_22/1, |
| 77 | + test_mdx_expression_flow_case_23/1, |
| 78 | + test_mdx_expression_flow_case_24/1, |
| 79 | + test_mdx_expression_flow_case_25/1, |
| 80 | + test_mdx_expression_flow_case_26/1, |
77 | 81 | test_mdx_expression_flow_case_27/1 |
78 | 82 | ]). |
79 | 83 |
|
@@ -132,6 +136,10 @@ groups() -> |
132 | 136 | test_mdx_expression_flow_case_20, |
133 | 137 | test_mdx_expression_flow_case_21, |
134 | 138 | test_mdx_expression_flow_case_22, |
| 139 | + test_mdx_expression_flow_case_23, |
| 140 | + test_mdx_expression_flow_case_24, |
| 141 | + test_mdx_expression_flow_case_25, |
| 142 | + test_mdx_expression_flow_case_26, |
135 | 143 | test_mdx_expression_flow_case_27 |
136 | 144 | ]} |
137 | 145 | ]. |
@@ -441,6 +449,175 @@ test_mdx_expression_flow_case_22(_Config) -> |
441 | 449 | ), |
442 | 450 | ok. |
443 | 451 |
|
| 452 | +-spec test_mdx_expression_flow_case_23(Config) -> markdown_test:testcase() when |
| 453 | + Config :: ct_suite:ct_config(). |
| 454 | +test_mdx_expression_flow_case_23(_Config) -> |
| 455 | + ?assertEqual( |
| 456 | + {ok, |
| 457 | + markdown_mdast_node:root(#markdown_mdast_root{ |
| 458 | + children = ?'vec!'([ |
| 459 | + markdown_mdast_node:blockquote(#markdown_mdast_blockquote{ |
| 460 | + children = ?'vec!'([ |
| 461 | + markdown_mdast_node:paragraph(#markdown_mdast_paragraph{ |
| 462 | + children = ?'vec!'([ |
| 463 | + markdown_mdast_node:text(#markdown_mdast_text{ |
| 464 | + value = <<"aaa ">>, |
| 465 | + position = {some, markdown_unist_position:new(1, 4, 3, 1, 8, 7)} |
| 466 | + }), |
| 467 | + markdown_mdast_node:mdx_jsx_text_element(#markdown_mdast_mdx_jsx_text_element{ |
| 468 | + children = ?'vec!'([]), |
| 469 | + name = {some, <<"b">>}, |
| 470 | + attributes = ?'vec!'([ |
| 471 | + markdown_mdast_attribute_content:property(#markdown_mdast_mdx_jsx_attribute{ |
| 472 | + name = <<"c">>, |
| 473 | + value = |
| 474 | + {some, |
| 475 | + markdown_mdast_attribute_value:expression( |
| 476 | + #markdown_mdast_attribute_value_expression{ |
| 477 | + value = <<"`\n d\n`">>, |
| 478 | + stops = ?'vec!'([ |
| 479 | + markdown_mdast_stop:new(0, 13), |
| 480 | + markdown_mdast_stop:new(1, 14), |
| 481 | + markdown_mdast_stop:new(2, 19), |
| 482 | + markdown_mdast_stop:new(6, 23), |
| 483 | + markdown_mdast_stop:new(7, 27) |
| 484 | + ]) |
| 485 | + } |
| 486 | + )} |
| 487 | + }) |
| 488 | + ]), |
| 489 | + position = {some, markdown_unist_position:new(1, 8, 7, 3, 9, 32)} |
| 490 | + }), |
| 491 | + markdown_mdast_node:text(#markdown_mdast_text{ |
| 492 | + value = <<" eee">>, |
| 493 | + position = {some, markdown_unist_position:new(3, 9, 32, 3, 13, 36)} |
| 494 | + }) |
| 495 | + ]), |
| 496 | + position = {some, markdown_unist_position:new(1, 3, 2, 3, 13, 36)} |
| 497 | + }) |
| 498 | + ]), |
| 499 | + position = {some, markdown_unist_position:new(1, 1, 0, 3, 13, 36)} |
| 500 | + }) |
| 501 | + ]), |
| 502 | + position = {some, markdown_unist_position:new(1, 1, 0, 3, 13, 36)} |
| 503 | + })}, |
| 504 | + markdown:to_mdast(<<"> aaa <b c={`\n> d\n> `} /> eee"/utf8>>, ?swc_parse), |
| 505 | + "should support template strings in JSX (text) in block quotes" |
| 506 | + ), |
| 507 | + ok. |
| 508 | + |
| 509 | +-spec test_mdx_expression_flow_case_24(Config) -> markdown_test:testcase() when |
| 510 | + Config :: ct_suite:ct_config(). |
| 511 | +test_mdx_expression_flow_case_24(_Config) -> |
| 512 | + ?assertEqual( |
| 513 | + {ok, |
| 514 | + markdown_mdast_node:root(#markdown_mdast_root{ |
| 515 | + children = ?'vec!'([ |
| 516 | + markdown_mdast_node:blockquote(#markdown_mdast_blockquote{ |
| 517 | + children = ?'vec!'([ |
| 518 | + markdown_mdast_node:paragraph(#markdown_mdast_paragraph{ |
| 519 | + children = ?'vec!'([ |
| 520 | + markdown_mdast_node:text(#markdown_mdast_text{ |
| 521 | + value = <<"ab ">>, |
| 522 | + position = {some, markdown_unist_position:new(1, 3, 2, 1, 6, 5)} |
| 523 | + }), |
| 524 | + markdown_mdast_node:mdx_text_expression(#markdown_mdast_mdx_text_expression{ |
| 525 | + value = <<"`\n`">>, |
| 526 | + stops = ?'vec!'([ |
| 527 | + markdown_mdast_stop:new(0, 6), |
| 528 | + markdown_mdast_stop:new(1, 7), |
| 529 | + markdown_mdast_stop:new(2, 10) |
| 530 | + ]), |
| 531 | + position = {some, markdown_unist_position:new(1, 6, 5, 2, 7, 12)} |
| 532 | + }) |
| 533 | + ]), |
| 534 | + position = {some, markdown_unist_position:new(1, 3, 2, 2, 7, 12)} |
| 535 | + }) |
| 536 | + ]), |
| 537 | + position = {some, markdown_unist_position:new(1, 1, 0, 2, 7, 12)} |
| 538 | + }) |
| 539 | + ]), |
| 540 | + position = {some, markdown_unist_position:new(1, 1, 0, 2, 7, 12)} |
| 541 | + })}, |
| 542 | + markdown:to_mdast(<<"> ab {`\n>\t`}"/utf8>>, ?swc_parse), |
| 543 | + "should use correct positional when there are virtual spaces due to a block quote" |
| 544 | + ), |
| 545 | + ok. |
| 546 | + |
| 547 | +-spec test_mdx_expression_flow_case_25(Config) -> markdown_test:testcase() when |
| 548 | + Config :: ct_suite:ct_config(). |
| 549 | +test_mdx_expression_flow_case_25(_Config) -> |
| 550 | + ?assertEqual( |
| 551 | + {ok, |
| 552 | + markdown_mdast_node:root(#markdown_mdast_root{ |
| 553 | + children = ?'vec!'([ |
| 554 | + markdown_mdast_node:blockquote(#markdown_mdast_blockquote{ |
| 555 | + children = ?'vec!'([ |
| 556 | + markdown_mdast_node:mdx_flow_expression(#markdown_mdast_mdx_flow_expression{ |
| 557 | + value = <<"`\nalpha\nbravo\ncharlie\n delta\n`">>, |
| 558 | + position = {some, markdown_unist_position:new(1, 3, 2, 6, 5, 49)}, |
| 559 | + stops = ?'vec!'([ |
| 560 | + markdown_mdast_stop:new(0, 3), |
| 561 | + markdown_mdast_stop:new(1, 4), |
| 562 | + markdown_mdast_stop:new(2, 7), |
| 563 | + markdown_mdast_stop:new(7, 12), |
| 564 | + markdown_mdast_stop:new(8, 16), |
| 565 | + markdown_mdast_stop:new(13, 21), |
| 566 | + markdown_mdast_stop:new(14, 26), |
| 567 | + markdown_mdast_stop:new(21, 33), |
| 568 | + markdown_mdast_stop:new(22, 38), |
| 569 | + markdown_mdast_stop:new(28, 44), |
| 570 | + markdown_mdast_stop:new(29, 47) |
| 571 | + ]) |
| 572 | + }) |
| 573 | + ]), |
| 574 | + position = {some, markdown_unist_position:new(1, 1, 0, 6, 5, 49)} |
| 575 | + }) |
| 576 | + ]), |
| 577 | + position = {some, markdown_unist_position:new(1, 1, 0, 6, 5, 49)} |
| 578 | + })}, |
| 579 | + markdown:to_mdast(<<"> {`\n> alpha\n> bravo\n> charlie\n> delta\n> `}"/utf8>>, ?swc_parse), |
| 580 | + "should keep the correct number of spaces in a blockquote (flow)" |
| 581 | + ), |
| 582 | + ok. |
| 583 | + |
| 584 | +-spec test_mdx_expression_flow_case_26(Config) -> markdown_test:testcase() when |
| 585 | + Config :: ct_suite:ct_config(). |
| 586 | +test_mdx_expression_flow_case_26(_Config) -> |
| 587 | + ?assertEqual( |
| 588 | + {ok, |
| 589 | + markdown_mdast_node:root(#markdown_mdast_root{ |
| 590 | + children = ?'vec!'([ |
| 591 | + markdown_mdast_node:blockquote(#markdown_mdast_blockquote{ |
| 592 | + children = ?'vec!'([ |
| 593 | + markdown_mdast_node:mdx_flow_expression(#markdown_mdast_mdx_flow_expression{ |
| 594 | + value = <<"`\nalpha\nbravo\ncharlie\n delta\n`">>, |
| 595 | + position = {some, markdown_unist_position:new(1, 3, 2, 6, 5, 49)}, |
| 596 | + stops = ?'vec!'([ |
| 597 | + markdown_mdast_stop:new(0, 3), |
| 598 | + markdown_mdast_stop:new(1, 4), |
| 599 | + markdown_mdast_stop:new(2, 7), |
| 600 | + markdown_mdast_stop:new(7, 12), |
| 601 | + markdown_mdast_stop:new(8, 16), |
| 602 | + markdown_mdast_stop:new(13, 21), |
| 603 | + markdown_mdast_stop:new(14, 26), |
| 604 | + markdown_mdast_stop:new(21, 33), |
| 605 | + markdown_mdast_stop:new(22, 38), |
| 606 | + markdown_mdast_stop:new(28, 44), |
| 607 | + markdown_mdast_stop:new(29, 47) |
| 608 | + ]) |
| 609 | + }) |
| 610 | + ]), |
| 611 | + position = {some, markdown_unist_position:new(1, 1, 0, 6, 5, 49)} |
| 612 | + }) |
| 613 | + ]), |
| 614 | + position = {some, markdown_unist_position:new(1, 1, 0, 6, 5, 49)} |
| 615 | + })}, |
| 616 | + markdown:to_mdast(<<"> {`\n> alpha\n> bravo\n> charlie\n> delta\n> `}"/utf8>>, ?swc_parse), |
| 617 | + "should keep the correct number of spaces in a blockquote (flow)" |
| 618 | + ), |
| 619 | + ok. |
| 620 | + |
444 | 621 | -spec test_mdx_expression_flow_case_27(Config) -> markdown_test:testcase() when |
445 | 622 | Config :: ct_suite:ct_config(). |
446 | 623 | test_mdx_expression_flow_case_27(_Config) -> |
|
0 commit comments