@rohal12/spindle 0.61.2 → 0.61.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -475,10 +475,11 @@ function peg$parse(input, options) {
475
475
  const peg$c11 = "}";
476
476
  const peg$c12 = "/";
477
477
  const peg$c13 = "@";
478
- const peg$c14 = "</";
479
- const peg$c15 = "=";
480
- const peg$c16 = "\"";
481
- const peg$c17 = "'";
478
+ const peg$c14 = ":";
479
+ const peg$c15 = "</";
480
+ const peg$c16 = "=";
481
+ const peg$c17 = "\"";
482
+ const peg$c18 = "'";
482
483
  const peg$r0 = /^[^\\{[<]/;
483
484
  const peg$r1 = /^[{}]/;
484
485
  const peg$r2 = /^[$_@%(!\/a-zA-Z]/;
@@ -491,14 +492,16 @@ function peg$parse(input, options) {
491
492
  const peg$r9 = /^[^ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF}]/;
492
493
  const peg$r10 = /^[a-zA-Z0-9.!#$%&'*+\/=?\^_`|~\-]/;
493
494
  const peg$r11 = /^[a-zA-Z0-9.\-]/;
494
- const peg$r12 = /^[\t-\r \/>\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
495
- const peg$r13 = /^[a-zA-Z0-9\-]/;
496
- const peg$r14 = /^[\t-\r "'\/<->{}\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
497
- const peg$r15 = /^[^"]/;
498
- const peg$r16 = /^[^']/;
499
- const peg$r17 = /^["']/;
500
- const peg$r18 = /^[^ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF>]/;
501
- const peg$r19 = /^[ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;
495
+ const peg$r12 = /^[a-zA-Z0-9+.\-]/;
496
+ const peg$r13 = /^[^\0- \x7F<>{}]/;
497
+ const peg$r14 = /^[\t-\r \/>\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
498
+ const peg$r15 = /^[a-zA-Z0-9\-]/;
499
+ const peg$r16 = /^[\t-\r "'\/<->{}\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
500
+ const peg$r17 = /^[^"]/;
501
+ const peg$r18 = /^[^']/;
502
+ const peg$r19 = /^["']/;
503
+ const peg$r20 = /^[^ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF>]/;
504
+ const peg$r21 = /^[ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;
502
505
  const peg$e0 = peg$anyExpectation();
503
506
  const peg$e1 = peg$classExpectation([
504
507
  "\\",
@@ -611,6 +614,23 @@ function peg$parse(input, options) {
611
614
  "-"
612
615
  ], false, false, false);
613
616
  const peg$e27 = peg$classExpectation([
617
+ ["a", "z"],
618
+ ["A", "Z"],
619
+ ["0", "9"],
620
+ "+",
621
+ ".",
622
+ "-"
623
+ ], false, false, false);
624
+ const peg$e28 = peg$literalExpectation(":", false);
625
+ const peg$e29 = peg$classExpectation([
626
+ ["\0", " "],
627
+ "",
628
+ "<",
629
+ ">",
630
+ "{",
631
+ "}"
632
+ ], true, false, false);
633
+ const peg$e30 = peg$classExpectation([
614
634
  [" ", "\r"],
615
635
  " ",
616
636
  "/",
@@ -624,14 +644,14 @@ function peg$parse(input, options) {
624
644
  " ",
625
645
  ""
626
646
  ], false, false, false);
627
- const peg$e28 = peg$literalExpectation("</", false);
628
- const peg$e29 = peg$classExpectation([
647
+ const peg$e31 = peg$literalExpectation("</", false);
648
+ const peg$e32 = peg$classExpectation([
629
649
  ["a", "z"],
630
650
  ["A", "Z"],
631
651
  ["0", "9"],
632
652
  "-"
633
653
  ], false, false, false);
634
- const peg$e30 = peg$classExpectation([
654
+ const peg$e33 = peg$classExpectation([
635
655
  [" ", "\r"],
636
656
  " ",
637
657
  "\"",
@@ -649,13 +669,13 @@ function peg$parse(input, options) {
649
669
  " ",
650
670
  ""
651
671
  ], false, false, false);
652
- const peg$e31 = peg$literalExpectation("=", false);
653
- const peg$e32 = peg$literalExpectation("\"", false);
654
- const peg$e33 = peg$classExpectation(["\""], true, false, false);
655
- const peg$e34 = peg$literalExpectation("'", false);
656
- const peg$e35 = peg$classExpectation(["'"], true, false, false);
657
- const peg$e36 = peg$classExpectation(["\"", "'"], false, false, false);
658
- const peg$e37 = peg$classExpectation([
672
+ const peg$e34 = peg$literalExpectation("=", false);
673
+ const peg$e35 = peg$literalExpectation("\"", false);
674
+ const peg$e36 = peg$classExpectation(["\""], true, false, false);
675
+ const peg$e37 = peg$literalExpectation("'", false);
676
+ const peg$e38 = peg$classExpectation(["'"], true, false, false);
677
+ const peg$e39 = peg$classExpectation(["\"", "'"], false, false, false);
678
+ const peg$e40 = peg$classExpectation([
659
679
  " ",
660
680
  " ",
661
681
  "\n",
@@ -673,7 +693,7 @@ function peg$parse(input, options) {
673
693
  "",
674
694
  ">"
675
695
  ], true, false, false);
676
- const peg$e38 = peg$classExpectation([
696
+ const peg$e41 = peg$classExpectation([
677
697
  " ",
678
698
  " ",
679
699
  "\n",
@@ -696,68 +716,71 @@ function peg$parse(input, options) {
696
716
  function peg$f1() {
697
717
  return !textMode;
698
718
  }
699
- function peg$f2(tag) {
719
+ function peg$f2() {
720
+ return !textMode;
721
+ }
722
+ function peg$f3(tag) {
700
723
  return tag;
701
724
  }
702
- function peg$f3() {
725
+ function peg$f4() {
703
726
  return !textMode;
704
727
  }
705
- function peg$f4(tag) {
728
+ function peg$f5(tag) {
706
729
  return VOID_TAGS.has(tag.lower) ? null : tag;
707
730
  }
708
- function peg$f5(tag) {
731
+ function peg$f6(tag) {
709
732
  rawName = tag.lower;
710
733
  return tag.kind === "open" && hooks.isRaw(rawName);
711
734
  }
712
- function peg$f6(tag, b) {
735
+ function peg$f7(tag, b) {
713
736
  return b;
714
737
  }
715
- function peg$f7(tag, body) {
738
+ function peg$f8(tag, body) {
716
739
  return body ? [tag, body] : tag;
717
740
  }
718
- function peg$f8(tag) {
741
+ function peg$f9(tag) {
719
742
  return tag.kind === "close";
720
743
  }
721
- function peg$f9(tag) {
744
+ function peg$f10(tag) {
722
745
  return tag;
723
746
  }
724
- function peg$f10() {
747
+ function peg$f11() {
725
748
  return !textMode;
726
749
  }
727
- function peg$f11(tag) {
750
+ function peg$f12(tag) {
728
751
  return tag;
729
752
  }
730
- function peg$f12(start) {
753
+ function peg$f13(start) {
731
754
  return skipTo(hooks.rawBodyEnd(input, start, rawName));
732
755
  }
733
- function peg$f13(start) {
756
+ function peg$f14(start) {
734
757
  return skipEnd - offset();
735
758
  }
736
- function peg$f14(start, body, end) {
759
+ function peg$f15(start, body, end) {
737
760
  const loc = {
738
761
  start: { offset: start },
739
762
  end: { offset: start + body.length }
740
763
  };
741
764
  return [body ? lexeme("text", loc, { value: body }) : null, end];
742
765
  }
743
- function peg$f15() {
766
+ function peg$f16() {
744
767
  return offset();
745
768
  }
746
- function peg$f16(value) {
769
+ function peg$f17(value) {
747
770
  return lexeme("text", location(), { value });
748
771
  }
749
- function peg$f17(value) {
772
+ function peg$f18(value) {
750
773
  const node = lexeme("text", location(), { value });
751
774
  node.comment = true;
752
775
  return node;
753
776
  }
754
- function peg$f18(bs) {
777
+ function peg$f19(bs) {
755
778
  return bs.length % 2 === 1;
756
779
  }
757
- function peg$f19(bs, c) {
780
+ function peg$f20(bs, c) {
758
781
  return c;
759
782
  }
760
- function peg$f20(bs, brace) {
783
+ function peg$f21(bs, brace) {
761
784
  const loc = location();
762
785
  const next = input.charAt(loc.end.offset);
763
786
  if (textMode) {
@@ -774,48 +797,48 @@ function peg$parse(input, options) {
774
797
  escaped.escape = true;
775
798
  return bs.length > 1 ? [before, escaped] : escaped;
776
799
  }
777
- function peg$f21() {
800
+ function peg$f22() {
778
801
  return lexeme("text", location(), { value: LB });
779
802
  }
780
- function peg$f22() {
803
+ function peg$f23() {
781
804
  return !textMode;
782
805
  }
783
- function peg$f23() {
806
+ function peg$f24() {
784
807
  return lexeme("text", location(), { value: "<" });
785
808
  }
786
- function peg$f24() {
809
+ function peg$f25() {
787
810
  return lexeme("text", location(), { value: "[" });
788
811
  }
789
- function peg$f25() {
812
+ function peg$f26() {
790
813
  return !textMode;
791
814
  }
792
- function peg$f26(ss, s, at, inner) {
815
+ function peg$f27(ss, s, at, inner) {
793
816
  const link = lexeme("link", location(), parseLink(inner, at, (separator) => linkSeparatorIndex(inner, at, separator)));
794
817
  link.selectorSpan = selectorSpan(s, ss, at);
795
818
  return withSelectors(link, s);
796
819
  }
797
- function peg$f27() {
820
+ function peg$f28() {
798
821
  return !textMode;
799
822
  }
800
- function peg$f28() {
823
+ function peg$f29() {
801
824
  fail("Unclosed link: [[ without ]]", location(), "unclosed-link");
802
825
  }
803
- function peg$f29(parts) {
826
+ function peg$f30(parts) {
804
827
  return selectorsOf(parts);
805
828
  }
806
- function peg$f30() {
829
+ function peg$f31() {
807
830
  return NO_SELECTORS;
808
831
  }
809
- function peg$f31(s, end) {
832
+ function peg$f32(s, end) {
810
833
  return {
811
834
  ...s,
812
835
  end
813
836
  };
814
837
  }
815
- function peg$f32(prefix, name) {
838
+ function peg$f33(prefix, name) {
816
839
  return [prefix, name];
817
840
  }
818
- function peg$f33(ss, s, sigil, nameStart, name) {
841
+ function peg$f34(ss, s, sigil, nameStart, name) {
819
842
  const variable = lexeme("variable", location(), {
820
843
  name,
821
844
  nameStart,
@@ -825,7 +848,7 @@ function peg$parse(input, options) {
825
848
  variable.selectorSpan = selectorSpan(s, ss, nameStart - 1);
826
849
  return withSelectors(variable, s);
827
850
  }
828
- function peg$f34(ss, s, after, expression) {
851
+ function peg$f35(ss, s, after, expression) {
829
852
  const node = lexeme("expression", location(), {
830
853
  expression,
831
854
  expressionStart: after,
@@ -834,28 +857,28 @@ function peg$parse(input, options) {
834
857
  node.selectorSpan = selectorSpan(s, ss, after);
835
858
  return withSelectors(node, s);
836
859
  }
837
- function peg$f35() {
860
+ function peg$f36() {
838
861
  fail("Unclosed {" + input.substr(location().end.offset, 1) + "…: no } ends it", location(), "unclosed-expression");
839
862
  }
840
- function peg$f36(start) {
863
+ function peg$f37(start) {
841
864
  return skipTo(hooks.closeBrace(input, start, start));
842
865
  }
843
- function peg$f37(start) {
866
+ function peg$f38(start) {
844
867
  return skipEnd - offset();
845
868
  }
846
- function peg$f38(start, code) {
869
+ function peg$f39(start, code) {
847
870
  return code;
848
871
  }
849
- function peg$f39(ss, s, start, close, name, nameEnd) {
872
+ function peg$f40(ss, s, start, close, name, nameEnd) {
850
873
  return skipTo(hooks.closeBrace(input, nameEnd, start));
851
874
  }
852
- function peg$f40(ss, s, start, close, name, nameEnd) {
875
+ function peg$f41(ss, s, start, close, name, nameEnd) {
853
876
  return skipEnd - offset();
854
877
  }
855
- function peg$f41(ss, s, start, close, name, nameEnd, args) {
878
+ function peg$f42(ss, s, start, close, name, nameEnd, args) {
856
879
  return args;
857
880
  }
858
- function peg$f42(ss, s, start, close, name, nameEnd, tail) {
881
+ function peg$f43(ss, s, start, close, name, nameEnd, tail) {
859
882
  const loc = location();
860
883
  const lower = name.toLowerCase();
861
884
  const tag = lexeme("macro", loc, {
@@ -881,16 +904,19 @@ function peg$parse(input, options) {
881
904
  }
882
905
  return tag;
883
906
  }
884
- function peg$f43(s) {
907
+ function peg$f44(s) {
885
908
  fail("A closing tag starts with a letter after {/", location(), "invalid-closer");
886
909
  }
887
- function peg$f44(value) {
910
+ function peg$f45(value) {
888
911
  return EMAIL_AUTOLINK.test(value);
889
912
  }
890
- function peg$f45(value) {
913
+ function peg$f46(value) {
891
914
  return lexeme("text", location(), { value });
892
915
  }
893
- function peg$f46(tagStart, tag, list, slash) {
916
+ function peg$f47(value) {
917
+ return lexeme("text", location(), { value });
918
+ }
919
+ function peg$f48(tagStart, tag, list, slash) {
894
920
  const lower = tag.toLowerCase();
895
921
  return lexeme("html", location(), {
896
922
  tag,
@@ -903,7 +929,7 @@ function peg$parse(input, options) {
903
929
  isSelfClose: !!slash || VOID_TAGS.has(lower)
904
930
  });
905
931
  }
906
- function peg$f47(tag, bad) {
932
+ function peg$f49(tag, bad) {
907
933
  const c = input.charAt(bad);
908
934
  if (!c) fail("Unclosed tag <" + tag + ": no > ends it (write &lt; for a < that starts no tag)", location(), "unclosed-tag");
909
935
  const at = {
@@ -921,7 +947,7 @@ function peg$parse(input, options) {
921
947
  };
922
948
  fail("Unexpected " + JSON.stringify(c) + " in the tag <" + tag + ">: expected an attribute, or > to end the tag", at, "unexpected-character");
923
949
  }
924
- function peg$f48(tagStart, tag) {
950
+ function peg$f50(tagStart, tag) {
925
951
  return lexeme("html", location(), {
926
952
  tag,
927
953
  lower: tag.toLowerCase(),
@@ -933,14 +959,14 @@ function peg$parse(input, options) {
933
959
  isSelfClose: false
934
960
  });
935
961
  }
936
- function peg$f49(nameStart, name) {
962
+ function peg$f51(nameStart, name) {
937
963
  attrCode = hooks.isCodeAttribute(name);
938
964
  return true;
939
965
  }
940
- function peg$f50(nameStart, name, v) {
966
+ function peg$f52(nameStart, name, v) {
941
967
  return v;
942
968
  }
943
- function peg$f51(nameStart, name, value) {
969
+ function peg$f53(nameStart, name, value) {
944
970
  const attribute = {
945
971
  name,
946
972
  value: value ? value.value : "",
@@ -954,7 +980,7 @@ function peg$parse(input, options) {
954
980
  }
955
981
  return attribute;
956
982
  }
957
- function peg$f52(start, value, end) {
983
+ function peg$f54(start, value, end) {
958
984
  return {
959
985
  value,
960
986
  start,
@@ -962,7 +988,7 @@ function peg$parse(input, options) {
962
988
  quote: "\""
963
989
  };
964
990
  }
965
- function peg$f53(start, value, end) {
991
+ function peg$f55(start, value, end) {
966
992
  return {
967
993
  value,
968
994
  start,
@@ -970,35 +996,35 @@ function peg$parse(input, options) {
970
996
  quote: "'"
971
997
  };
972
998
  }
973
- function peg$f54(q) {
999
+ function peg$f56(q) {
974
1000
  fail("Unclosed attribute value: the " + q + " here has no closing " + q, location(), "unclosed-attribute");
975
1001
  }
976
- function peg$f55(start, value, end) {
1002
+ function peg$f57(start, value, end) {
977
1003
  return {
978
1004
  value,
979
1005
  start,
980
1006
  end
981
1007
  };
982
1008
  }
983
- function peg$f56() {
1009
+ function peg$f58() {
984
1010
  return !attrCode;
985
1011
  }
986
- function peg$f57(bs) {
1012
+ function peg$f59(bs) {
987
1013
  return bs.length % 2 === 1;
988
1014
  }
989
- function peg$f58() {
1015
+ function peg$f60() {
990
1016
  return !attrCode;
991
1017
  }
992
- function peg$f59(start, nameEnd) {
1018
+ function peg$f61(start, nameEnd) {
993
1019
  return skipTo(hooks.closeBrace(input, nameEnd, start));
994
1020
  }
995
- function peg$f60(start, nameEnd) {
1021
+ function peg$f62(start, nameEnd) {
996
1022
  return skipEnd - offset();
997
1023
  }
998
- function peg$f61() {
1024
+ function peg$f63() {
999
1025
  return !attrCode;
1000
1026
  }
1001
- function peg$f62() {
1027
+ function peg$f64() {
1002
1028
  return attrCode;
1003
1029
  }
1004
1030
  let peg$currPos = options.peg$currPos | 0;
@@ -1146,10 +1172,10 @@ function peg$parse(input, options) {
1146
1172
  if (s1) s1 = void 0;
1147
1173
  else s1 = peg$FAILED;
1148
1174
  if (s1 !== peg$FAILED) {
1149
- s2 = peg$parseHtmlOpen();
1175
+ s2 = peg$parseUriAutolink();
1150
1176
  if (s2 !== peg$FAILED) {
1151
- peg$savedPos = s0;
1152
- s0 = peg$f2(s2);
1177
+ s1 = [s1, s2];
1178
+ s0 = s1;
1153
1179
  } else {
1154
1180
  peg$currPos = s0;
1155
1181
  s0 = peg$FAILED;
@@ -1161,14 +1187,14 @@ function peg$parse(input, options) {
1161
1187
  if (s0 === peg$FAILED) {
1162
1188
  s0 = peg$currPos;
1163
1189
  peg$savedPos = peg$currPos;
1164
- s1 = peg$f3();
1190
+ s1 = peg$f2();
1165
1191
  if (s1) s1 = void 0;
1166
1192
  else s1 = peg$FAILED;
1167
1193
  if (s1 !== peg$FAILED) {
1168
- s2 = peg$parseHtmlClose();
1194
+ s2 = peg$parseHtmlOpen();
1169
1195
  if (s2 !== peg$FAILED) {
1170
1196
  peg$savedPos = s0;
1171
- s0 = peg$f4(s2);
1197
+ s0 = peg$f3(s2);
1172
1198
  } else {
1173
1199
  peg$currPos = s0;
1174
1200
  s0 = peg$FAILED;
@@ -1178,37 +1204,57 @@ function peg$parse(input, options) {
1178
1204
  s0 = peg$FAILED;
1179
1205
  }
1180
1206
  if (s0 === peg$FAILED) {
1181
- s0 = peg$parseValue();
1207
+ s0 = peg$currPos;
1208
+ peg$savedPos = peg$currPos;
1209
+ s1 = peg$f4();
1210
+ if (s1) s1 = void 0;
1211
+ else s1 = peg$FAILED;
1212
+ if (s1 !== peg$FAILED) {
1213
+ s2 = peg$parseHtmlClose();
1214
+ if (s2 !== peg$FAILED) {
1215
+ peg$savedPos = s0;
1216
+ s0 = peg$f5(s2);
1217
+ } else {
1218
+ peg$currPos = s0;
1219
+ s0 = peg$FAILED;
1220
+ }
1221
+ } else {
1222
+ peg$currPos = s0;
1223
+ s0 = peg$FAILED;
1224
+ }
1182
1225
  if (s0 === peg$FAILED) {
1183
- s0 = peg$currPos;
1184
- s1 = peg$parseMacroTag();
1185
- if (s1 !== peg$FAILED) {
1186
- s2 = peg$currPos;
1187
- peg$savedPos = peg$currPos;
1188
- s3 = peg$f5(s1);
1189
- if (s3) s3 = void 0;
1190
- else s3 = peg$FAILED;
1191
- if (s3 !== peg$FAILED) {
1192
- s4 = peg$parseRawTokens();
1193
- if (s4 !== peg$FAILED) {
1194
- peg$savedPos = s2;
1195
- s2 = peg$f6(s1, s4);
1226
+ s0 = peg$parseValue();
1227
+ if (s0 === peg$FAILED) {
1228
+ s0 = peg$currPos;
1229
+ s1 = peg$parseMacroTag();
1230
+ if (s1 !== peg$FAILED) {
1231
+ s2 = peg$currPos;
1232
+ peg$savedPos = peg$currPos;
1233
+ s3 = peg$f6(s1);
1234
+ if (s3) s3 = void 0;
1235
+ else s3 = peg$FAILED;
1236
+ if (s3 !== peg$FAILED) {
1237
+ s4 = peg$parseRawTokens();
1238
+ if (s4 !== peg$FAILED) {
1239
+ peg$savedPos = s2;
1240
+ s2 = peg$f7(s1, s4);
1241
+ } else {
1242
+ peg$currPos = s2;
1243
+ s2 = peg$FAILED;
1244
+ }
1196
1245
  } else {
1197
1246
  peg$currPos = s2;
1198
1247
  s2 = peg$FAILED;
1199
1248
  }
1249
+ if (s2 === peg$FAILED) s2 = null;
1250
+ peg$savedPos = s0;
1251
+ s0 = peg$f8(s1, s2);
1200
1252
  } else {
1201
- peg$currPos = s2;
1202
- s2 = peg$FAILED;
1253
+ peg$currPos = s0;
1254
+ s0 = peg$FAILED;
1203
1255
  }
1204
- if (s2 === peg$FAILED) s2 = null;
1205
- peg$savedPos = s0;
1206
- s0 = peg$f7(s1, s2);
1207
- } else {
1208
- peg$currPos = s0;
1209
- s0 = peg$FAILED;
1256
+ if (s0 === peg$FAILED) s0 = peg$parseLiteral();
1210
1257
  }
1211
- if (s0 === peg$FAILED) s0 = peg$parseLiteral();
1212
1258
  }
1213
1259
  }
1214
1260
  }
@@ -1225,12 +1271,12 @@ function peg$parse(input, options) {
1225
1271
  s1 = peg$parseMacroTag();
1226
1272
  if (s1 !== peg$FAILED) {
1227
1273
  peg$savedPos = peg$currPos;
1228
- s2 = peg$f8(s1);
1274
+ s2 = peg$f9(s1);
1229
1275
  if (s2) s2 = void 0;
1230
1276
  else s2 = peg$FAILED;
1231
1277
  if (s2 !== peg$FAILED) {
1232
1278
  peg$savedPos = s0;
1233
- s0 = peg$f9(s1);
1279
+ s0 = peg$f10(s1);
1234
1280
  } else {
1235
1281
  peg$currPos = s0;
1236
1282
  s0 = peg$FAILED;
@@ -1242,14 +1288,14 @@ function peg$parse(input, options) {
1242
1288
  if (s0 === peg$FAILED) {
1243
1289
  s0 = peg$currPos;
1244
1290
  peg$savedPos = peg$currPos;
1245
- s1 = peg$f10();
1291
+ s1 = peg$f11();
1246
1292
  if (s1) s1 = void 0;
1247
1293
  else s1 = peg$FAILED;
1248
1294
  if (s1 !== peg$FAILED) {
1249
1295
  s2 = peg$parseHtmlClose();
1250
1296
  if (s2 !== peg$FAILED) {
1251
1297
  peg$savedPos = s0;
1252
- s0 = peg$f11(s2);
1298
+ s0 = peg$f12(s2);
1253
1299
  } else {
1254
1300
  peg$currPos = s0;
1255
1301
  s0 = peg$FAILED;
@@ -1266,12 +1312,12 @@ function peg$parse(input, options) {
1266
1312
  s0 = peg$currPos;
1267
1313
  s1 = peg$parseHere();
1268
1314
  peg$savedPos = peg$currPos;
1269
- s2 = peg$f12(s1);
1315
+ s2 = peg$f13(s1);
1270
1316
  if (s2) s2 = void 0;
1271
1317
  else s2 = peg$FAILED;
1272
1318
  if (s2 !== peg$FAILED) {
1273
1319
  s3 = peg$currPos;
1274
- s4 = peg$f13(s1);
1320
+ s4 = peg$f14(s1);
1275
1321
  s5 = peg$currPos;
1276
1322
  s6 = [];
1277
1323
  if (s6.length >= (s4 | 0)) s7 = peg$FAILED;
@@ -1304,7 +1350,7 @@ function peg$parse(input, options) {
1304
1350
  s4 = peg$parseCloseTag();
1305
1351
  if (s4 !== peg$FAILED) {
1306
1352
  peg$savedPos = s0;
1307
- s0 = peg$f14(s1, s3, s4);
1353
+ s0 = peg$f15(s1, s3, s4);
1308
1354
  } else {
1309
1355
  peg$currPos = s0;
1310
1356
  s0 = peg$FAILED;
@@ -1324,7 +1370,7 @@ function peg$parse(input, options) {
1324
1370
  s0 = peg$currPos;
1325
1371
  s1 = "";
1326
1372
  peg$savedPos = s0;
1327
- s1 = peg$f15();
1373
+ s1 = peg$f16();
1328
1374
  s0 = s1;
1329
1375
  return s0;
1330
1376
  }
@@ -1353,7 +1399,7 @@ function peg$parse(input, options) {
1353
1399
  else s1 = s2;
1354
1400
  if (s1 !== peg$FAILED) {
1355
1401
  peg$savedPos = s0;
1356
- s1 = peg$f16(s1);
1402
+ s1 = peg$f17(s1);
1357
1403
  }
1358
1404
  s0 = s1;
1359
1405
  return s0;
@@ -1493,7 +1539,7 @@ function peg$parse(input, options) {
1493
1539
  else s1 = s2;
1494
1540
  if (s1 !== peg$FAILED) {
1495
1541
  peg$savedPos = s0;
1496
- s1 = peg$f17(s1);
1542
+ s1 = peg$f18(s1);
1497
1543
  }
1498
1544
  s0 = s1;
1499
1545
  return s0;
@@ -1526,7 +1572,7 @@ function peg$parse(input, options) {
1526
1572
  if (s1 !== peg$FAILED) {
1527
1573
  s2 = peg$currPos;
1528
1574
  peg$savedPos = peg$currPos;
1529
- s3 = peg$f18(s1);
1575
+ s3 = peg$f19(s1);
1530
1576
  if (s3) s3 = void 0;
1531
1577
  else s3 = peg$FAILED;
1532
1578
  if (s3 !== peg$FAILED) {
@@ -1538,7 +1584,7 @@ function peg$parse(input, options) {
1538
1584
  }
1539
1585
  if (s4 !== peg$FAILED) {
1540
1586
  peg$savedPos = s2;
1541
- s2 = peg$f19(s1, s4);
1587
+ s2 = peg$f20(s1, s4);
1542
1588
  } else {
1543
1589
  peg$currPos = s2;
1544
1590
  s2 = peg$FAILED;
@@ -1549,7 +1595,7 @@ function peg$parse(input, options) {
1549
1595
  }
1550
1596
  if (s2 === peg$FAILED) s2 = null;
1551
1597
  peg$savedPos = s0;
1552
- s0 = peg$f20(s1, s2);
1598
+ s0 = peg$f21(s1, s2);
1553
1599
  } else {
1554
1600
  peg$currPos = s0;
1555
1601
  s0 = peg$FAILED;
@@ -1597,7 +1643,7 @@ function peg$parse(input, options) {
1597
1643
  }
1598
1644
  if (s2 !== peg$FAILED) {
1599
1645
  peg$savedPos = s0;
1600
- s0 = peg$f21();
1646
+ s0 = peg$f22();
1601
1647
  } else {
1602
1648
  peg$currPos = s0;
1603
1649
  s0 = peg$FAILED;
@@ -1612,7 +1658,7 @@ function peg$parse(input, options) {
1612
1658
  peg$silentFails++;
1613
1659
  s2 = peg$currPos;
1614
1660
  peg$savedPos = peg$currPos;
1615
- s3 = peg$f22();
1661
+ s3 = peg$f23();
1616
1662
  if (s3) s3 = void 0;
1617
1663
  else s3 = peg$FAILED;
1618
1664
  if (s3 !== peg$FAILED) {
@@ -1644,7 +1690,7 @@ function peg$parse(input, options) {
1644
1690
  }
1645
1691
  if (s2 !== peg$FAILED) {
1646
1692
  peg$savedPos = s0;
1647
- s0 = peg$f23();
1693
+ s0 = peg$f24();
1648
1694
  } else {
1649
1695
  peg$currPos = s0;
1650
1696
  s0 = peg$FAILED;
@@ -1664,7 +1710,7 @@ function peg$parse(input, options) {
1664
1710
  }
1665
1711
  if (s1 !== peg$FAILED) {
1666
1712
  peg$savedPos = s0;
1667
- s1 = peg$f24();
1713
+ s1 = peg$f25();
1668
1714
  }
1669
1715
  s0 = s1;
1670
1716
  }
@@ -1675,7 +1721,7 @@ function peg$parse(input, options) {
1675
1721
  let s0, s1, s2, s3, s4, s5, s6, s7;
1676
1722
  s0 = peg$currPos;
1677
1723
  peg$savedPos = peg$currPos;
1678
- s1 = peg$f25();
1724
+ s1 = peg$f26();
1679
1725
  if (s1) s1 = void 0;
1680
1726
  else s1 = peg$FAILED;
1681
1727
  if (s1 !== peg$FAILED) {
@@ -1703,7 +1749,7 @@ function peg$parse(input, options) {
1703
1749
  }
1704
1750
  if (s7 !== peg$FAILED) {
1705
1751
  peg$savedPos = s0;
1706
- s0 = peg$f26(s3, s4, s5, s6);
1752
+ s0 = peg$f27(s3, s4, s5, s6);
1707
1753
  } else {
1708
1754
  peg$currPos = s0;
1709
1755
  s0 = peg$FAILED;
@@ -1723,7 +1769,7 @@ function peg$parse(input, options) {
1723
1769
  if (s0 === peg$FAILED) {
1724
1770
  s0 = peg$currPos;
1725
1771
  peg$savedPos = peg$currPos;
1726
- s1 = peg$f27();
1772
+ s1 = peg$f28();
1727
1773
  if (s1) s1 = void 0;
1728
1774
  else s1 = peg$FAILED;
1729
1775
  if (s1 !== peg$FAILED) {
@@ -1736,7 +1782,7 @@ function peg$parse(input, options) {
1736
1782
  }
1737
1783
  if (s2 !== peg$FAILED) {
1738
1784
  peg$savedPos = s0;
1739
- s0 = peg$f28();
1785
+ s0 = peg$f29();
1740
1786
  } else {
1741
1787
  peg$currPos = s0;
1742
1788
  s0 = peg$FAILED;
@@ -1864,7 +1910,7 @@ function peg$parse(input, options) {
1864
1910
  }
1865
1911
  if (s2 === peg$FAILED) s2 = null;
1866
1912
  peg$savedPos = s0;
1867
- s0 = peg$f29(s1);
1913
+ s0 = peg$f30(s1);
1868
1914
  } else {
1869
1915
  peg$currPos = s0;
1870
1916
  s0 = peg$FAILED;
@@ -1873,7 +1919,7 @@ function peg$parse(input, options) {
1873
1919
  s0 = peg$currPos;
1874
1920
  s1 = "";
1875
1921
  peg$savedPos = s0;
1876
- s1 = peg$f30();
1922
+ s1 = peg$f31();
1877
1923
  s0 = s1;
1878
1924
  }
1879
1925
  return s0;
@@ -1903,7 +1949,7 @@ function peg$parse(input, options) {
1903
1949
  }
1904
1950
  }
1905
1951
  peg$savedPos = s0;
1906
- s0 = peg$f31(s1, s2);
1952
+ s0 = peg$f32(s1, s2);
1907
1953
  } else {
1908
1954
  peg$currPos = s0;
1909
1955
  s0 = peg$FAILED;
@@ -1929,7 +1975,7 @@ function peg$parse(input, options) {
1929
1975
  }
1930
1976
  s2 = input.substring(s2, peg$currPos);
1931
1977
  peg$savedPos = s0;
1932
- s0 = peg$f32(s1, s2);
1978
+ s0 = peg$f33(s1, s2);
1933
1979
  } else {
1934
1980
  peg$currPos = s0;
1935
1981
  s0 = peg$FAILED;
@@ -2056,7 +2102,7 @@ function peg$parse(input, options) {
2056
2102
  }
2057
2103
  if (s7 !== peg$FAILED) {
2058
2104
  peg$savedPos = s0;
2059
- s0 = peg$f33(s2, s3, s4, s5, s6);
2105
+ s0 = peg$f34(s2, s3, s4, s5, s6);
2060
2106
  } else {
2061
2107
  peg$currPos = s0;
2062
2108
  s0 = peg$FAILED;
@@ -2112,7 +2158,7 @@ function peg$parse(input, options) {
2112
2158
  }
2113
2159
  if (s7 !== peg$FAILED) {
2114
2160
  peg$savedPos = s0;
2115
- s0 = peg$f34(s2, s3, s4, s6);
2161
+ s0 = peg$f35(s2, s3, s4, s6);
2116
2162
  } else {
2117
2163
  peg$currPos = s0;
2118
2164
  s0 = peg$FAILED;
@@ -2160,7 +2206,7 @@ function peg$parse(input, options) {
2160
2206
  } else s3 = peg$FAILED;
2161
2207
  if (s3 !== peg$FAILED) {
2162
2208
  peg$savedPos = s0;
2163
- s0 = peg$f35();
2209
+ s0 = peg$f36();
2164
2210
  } else {
2165
2211
  peg$currPos = s0;
2166
2212
  s0 = peg$FAILED;
@@ -2182,12 +2228,12 @@ function peg$parse(input, options) {
2182
2228
  s0 = peg$currPos;
2183
2229
  s1 = peg$parseHere();
2184
2230
  peg$savedPos = peg$currPos;
2185
- s2 = peg$f36(s1);
2231
+ s2 = peg$f37(s1);
2186
2232
  if (s2) s2 = void 0;
2187
2233
  else s2 = peg$FAILED;
2188
2234
  if (s2 !== peg$FAILED) {
2189
2235
  s3 = peg$currPos;
2190
- s4 = peg$f37(s1);
2236
+ s4 = peg$f38(s1);
2191
2237
  s5 = peg$currPos;
2192
2238
  s6 = [];
2193
2239
  if (s6.length >= (s4 | 0)) s7 = peg$FAILED;
@@ -2218,7 +2264,7 @@ function peg$parse(input, options) {
2218
2264
  else s3 = s4;
2219
2265
  if (s3 !== peg$FAILED) {
2220
2266
  peg$savedPos = s0;
2221
- s0 = peg$f38(s1, s3);
2267
+ s0 = peg$f39(s1, s3);
2222
2268
  } else {
2223
2269
  peg$currPos = s0;
2224
2270
  s0 = peg$FAILED;
@@ -2257,12 +2303,12 @@ function peg$parse(input, options) {
2257
2303
  s7 = peg$parseHere();
2258
2304
  s8 = peg$currPos;
2259
2305
  peg$savedPos = peg$currPos;
2260
- s9 = peg$f39(s2, s3, s4, s5, s6, s7);
2306
+ s9 = peg$f40(s2, s3, s4, s5, s6, s7);
2261
2307
  if (s9) s9 = void 0;
2262
2308
  else s9 = peg$FAILED;
2263
2309
  if (s9 !== peg$FAILED) {
2264
2310
  s10 = peg$currPos;
2265
- s11 = peg$f40(s2, s3, s4, s5, s6, s7);
2311
+ s11 = peg$f41(s2, s3, s4, s5, s6, s7);
2266
2312
  s12 = peg$currPos;
2267
2313
  s13 = [];
2268
2314
  if (s13.length >= (s11 | 0)) s14 = peg$FAILED;
@@ -2301,7 +2347,7 @@ function peg$parse(input, options) {
2301
2347
  }
2302
2348
  if (s11 !== peg$FAILED) {
2303
2349
  peg$savedPos = s8;
2304
- s8 = peg$f41(s2, s3, s4, s5, s6, s7, s10);
2350
+ s8 = peg$f42(s2, s3, s4, s5, s6, s7, s10);
2305
2351
  } else {
2306
2352
  peg$currPos = s8;
2307
2353
  s8 = peg$FAILED;
@@ -2316,7 +2362,7 @@ function peg$parse(input, options) {
2316
2362
  }
2317
2363
  if (s8 === peg$FAILED) s8 = null;
2318
2364
  peg$savedPos = s0;
2319
- s0 = peg$f42(s2, s3, s4, s5, s6, s7, s8);
2365
+ s0 = peg$f43(s2, s3, s4, s5, s6, s7, s8);
2320
2366
  } else {
2321
2367
  peg$currPos = s0;
2322
2368
  s0 = peg$FAILED;
@@ -2350,7 +2396,7 @@ function peg$parse(input, options) {
2350
2396
  }
2351
2397
  if (s3 !== peg$FAILED) {
2352
2398
  peg$savedPos = s0;
2353
- s0 = peg$f43(s2);
2399
+ s0 = peg$f44(s2);
2354
2400
  } else {
2355
2401
  peg$currPos = s0;
2356
2402
  s0 = peg$FAILED;
@@ -2500,12 +2546,12 @@ function peg$parse(input, options) {
2500
2546
  else s1 = s2;
2501
2547
  if (s1 !== peg$FAILED) {
2502
2548
  peg$savedPos = peg$currPos;
2503
- s2 = peg$f44(s1);
2549
+ s2 = peg$f45(s1);
2504
2550
  if (s2) s2 = void 0;
2505
2551
  else s2 = peg$FAILED;
2506
2552
  if (s2 !== peg$FAILED) {
2507
2553
  peg$savedPos = s0;
2508
- s0 = peg$f45(s1);
2554
+ s0 = peg$f46(s1);
2509
2555
  } else {
2510
2556
  peg$currPos = s0;
2511
2557
  s0 = peg$FAILED;
@@ -2516,6 +2562,177 @@ function peg$parse(input, options) {
2516
2562
  }
2517
2563
  return s0;
2518
2564
  }
2565
+ function peg$parseUriAutolink() {
2566
+ let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
2567
+ s0 = peg$currPos;
2568
+ s1 = peg$currPos;
2569
+ s2 = peg$currPos;
2570
+ if (input.charCodeAt(peg$currPos) === 60) {
2571
+ s3 = peg$c6;
2572
+ peg$currPos++;
2573
+ } else {
2574
+ s3 = peg$FAILED;
2575
+ if (peg$silentFails === 0) peg$fail(peg$e10);
2576
+ }
2577
+ if (s3 !== peg$FAILED) {
2578
+ s4 = input.charAt(peg$currPos);
2579
+ if (peg$r8.test(s4)) peg$currPos++;
2580
+ else {
2581
+ s4 = peg$FAILED;
2582
+ if (peg$silentFails === 0) peg$fail(peg$e22);
2583
+ }
2584
+ if (s4 !== peg$FAILED) {
2585
+ s5 = peg$currPos;
2586
+ s6 = [];
2587
+ s7 = input.charAt(peg$currPos);
2588
+ if (peg$r12.test(s7)) peg$currPos++;
2589
+ else {
2590
+ s7 = peg$FAILED;
2591
+ if (peg$silentFails === 0) peg$fail(peg$e27);
2592
+ }
2593
+ while (s7 !== peg$FAILED) {
2594
+ s6.push(s7);
2595
+ if (s6.length >= 31) s7 = peg$FAILED;
2596
+ else {
2597
+ s7 = input.charAt(peg$currPos);
2598
+ if (peg$r12.test(s7)) peg$currPos++;
2599
+ else {
2600
+ s7 = peg$FAILED;
2601
+ if (peg$silentFails === 0) peg$fail(peg$e27);
2602
+ }
2603
+ }
2604
+ }
2605
+ if (s6.length < 1) {
2606
+ peg$currPos = s5;
2607
+ s5 = peg$FAILED;
2608
+ } else s5 = s6;
2609
+ if (s5 !== peg$FAILED) {
2610
+ if (input.charCodeAt(peg$currPos) === 58) {
2611
+ s6 = peg$c14;
2612
+ peg$currPos++;
2613
+ } else {
2614
+ s6 = peg$FAILED;
2615
+ if (peg$silentFails === 0) peg$fail(peg$e28);
2616
+ }
2617
+ if (s6 !== peg$FAILED) {
2618
+ s7 = [];
2619
+ s8 = peg$currPos;
2620
+ s9 = peg$currPos;
2621
+ peg$silentFails++;
2622
+ if (input.substr(peg$currPos, 2) === peg$c8) {
2623
+ s10 = peg$c8;
2624
+ peg$currPos += 2;
2625
+ } else {
2626
+ s10 = peg$FAILED;
2627
+ if (peg$silentFails === 0) peg$fail(peg$e12);
2628
+ }
2629
+ peg$silentFails--;
2630
+ if (s10 === peg$FAILED) s9 = void 0;
2631
+ else {
2632
+ peg$currPos = s9;
2633
+ s9 = peg$FAILED;
2634
+ }
2635
+ if (s9 !== peg$FAILED) {
2636
+ s10 = input.charAt(peg$currPos);
2637
+ if (peg$r13.test(s10)) peg$currPos++;
2638
+ else {
2639
+ s10 = peg$FAILED;
2640
+ if (peg$silentFails === 0) peg$fail(peg$e29);
2641
+ }
2642
+ if (s10 !== peg$FAILED) {
2643
+ s9 = [s9, s10];
2644
+ s8 = s9;
2645
+ } else {
2646
+ peg$currPos = s8;
2647
+ s8 = peg$FAILED;
2648
+ }
2649
+ } else {
2650
+ peg$currPos = s8;
2651
+ s8 = peg$FAILED;
2652
+ }
2653
+ while (s8 !== peg$FAILED) {
2654
+ s7.push(s8);
2655
+ s8 = peg$currPos;
2656
+ s9 = peg$currPos;
2657
+ peg$silentFails++;
2658
+ if (input.substr(peg$currPos, 2) === peg$c8) {
2659
+ s10 = peg$c8;
2660
+ peg$currPos += 2;
2661
+ } else {
2662
+ s10 = peg$FAILED;
2663
+ if (peg$silentFails === 0) peg$fail(peg$e12);
2664
+ }
2665
+ peg$silentFails--;
2666
+ if (s10 === peg$FAILED) s9 = void 0;
2667
+ else {
2668
+ peg$currPos = s9;
2669
+ s9 = peg$FAILED;
2670
+ }
2671
+ if (s9 !== peg$FAILED) {
2672
+ s10 = input.charAt(peg$currPos);
2673
+ if (peg$r13.test(s10)) peg$currPos++;
2674
+ else {
2675
+ s10 = peg$FAILED;
2676
+ if (peg$silentFails === 0) peg$fail(peg$e29);
2677
+ }
2678
+ if (s10 !== peg$FAILED) {
2679
+ s9 = [s9, s10];
2680
+ s8 = s9;
2681
+ } else {
2682
+ peg$currPos = s8;
2683
+ s8 = peg$FAILED;
2684
+ }
2685
+ } else {
2686
+ peg$currPos = s8;
2687
+ s8 = peg$FAILED;
2688
+ }
2689
+ }
2690
+ if (input.charCodeAt(peg$currPos) === 62) {
2691
+ s8 = peg$c1;
2692
+ peg$currPos++;
2693
+ } else {
2694
+ s8 = peg$FAILED;
2695
+ if (peg$silentFails === 0) peg$fail(peg$e3);
2696
+ }
2697
+ if (s8 !== peg$FAILED) {
2698
+ s3 = [
2699
+ s3,
2700
+ s4,
2701
+ s5,
2702
+ s6,
2703
+ s7,
2704
+ s8
2705
+ ];
2706
+ s2 = s3;
2707
+ } else {
2708
+ peg$currPos = s2;
2709
+ s2 = peg$FAILED;
2710
+ }
2711
+ } else {
2712
+ peg$currPos = s2;
2713
+ s2 = peg$FAILED;
2714
+ }
2715
+ } else {
2716
+ peg$currPos = s2;
2717
+ s2 = peg$FAILED;
2718
+ }
2719
+ } else {
2720
+ peg$currPos = s2;
2721
+ s2 = peg$FAILED;
2722
+ }
2723
+ } else {
2724
+ peg$currPos = s2;
2725
+ s2 = peg$FAILED;
2726
+ }
2727
+ if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
2728
+ else s1 = s2;
2729
+ if (s1 !== peg$FAILED) {
2730
+ peg$savedPos = s0;
2731
+ s1 = peg$f47(s1);
2732
+ }
2733
+ s0 = s1;
2734
+ return s0;
2735
+ }
2519
2736
  function peg$parseHtmlOpen() {
2520
2737
  let s0, s1, s2, s3, s4, s5, s6, s7;
2521
2738
  s0 = peg$currPos;
@@ -2554,7 +2771,7 @@ function peg$parse(input, options) {
2554
2771
  }
2555
2772
  if (s7 !== peg$FAILED) {
2556
2773
  peg$savedPos = s0;
2557
- s0 = peg$f46(s2, s3, s4, s6);
2774
+ s0 = peg$f48(s2, s3, s4, s6);
2558
2775
  } else {
2559
2776
  peg$currPos = s0;
2560
2777
  s0 = peg$FAILED;
@@ -2582,10 +2799,10 @@ function peg$parse(input, options) {
2582
2799
  s3 = peg$currPos;
2583
2800
  peg$silentFails++;
2584
2801
  s4 = input.charAt(peg$currPos);
2585
- if (peg$r12.test(s4)) peg$currPos++;
2802
+ if (peg$r14.test(s4)) peg$currPos++;
2586
2803
  else {
2587
2804
  s4 = peg$FAILED;
2588
- if (peg$silentFails === 0) peg$fail(peg$e27);
2805
+ if (peg$silentFails === 0) peg$fail(peg$e30);
2589
2806
  }
2590
2807
  if (s4 === peg$FAILED) {
2591
2808
  s4 = peg$currPos;
@@ -2619,7 +2836,7 @@ function peg$parse(input, options) {
2619
2836
  s5 = peg$parse_();
2620
2837
  s6 = peg$parseHere();
2621
2838
  peg$savedPos = s0;
2622
- s0 = peg$f47(s2, s6);
2839
+ s0 = peg$f49(s2, s6);
2623
2840
  } else {
2624
2841
  peg$currPos = s0;
2625
2842
  s0 = peg$FAILED;
@@ -2638,12 +2855,12 @@ function peg$parse(input, options) {
2638
2855
  function peg$parseHtmlClose() {
2639
2856
  let s0, s1, s2, s3, s5;
2640
2857
  s0 = peg$currPos;
2641
- if (input.substr(peg$currPos, 2) === peg$c14) {
2642
- s1 = peg$c14;
2858
+ if (input.substr(peg$currPos, 2) === peg$c15) {
2859
+ s1 = peg$c15;
2643
2860
  peg$currPos += 2;
2644
2861
  } else {
2645
2862
  s1 = peg$FAILED;
2646
- if (peg$silentFails === 0) peg$fail(peg$e28);
2863
+ if (peg$silentFails === 0) peg$fail(peg$e31);
2647
2864
  }
2648
2865
  if (s1 !== peg$FAILED) {
2649
2866
  s2 = peg$parseHere();
@@ -2659,7 +2876,7 @@ function peg$parse(input, options) {
2659
2876
  }
2660
2877
  if (s5 !== peg$FAILED) {
2661
2878
  peg$savedPos = s0;
2662
- s0 = peg$f48(s2, s3);
2879
+ s0 = peg$f50(s2, s3);
2663
2880
  } else {
2664
2881
  peg$currPos = s0;
2665
2882
  s0 = peg$FAILED;
@@ -2687,18 +2904,18 @@ function peg$parse(input, options) {
2687
2904
  if (s2 !== peg$FAILED) {
2688
2905
  s3 = [];
2689
2906
  s4 = input.charAt(peg$currPos);
2690
- if (peg$r13.test(s4)) peg$currPos++;
2907
+ if (peg$r15.test(s4)) peg$currPos++;
2691
2908
  else {
2692
2909
  s4 = peg$FAILED;
2693
- if (peg$silentFails === 0) peg$fail(peg$e29);
2910
+ if (peg$silentFails === 0) peg$fail(peg$e32);
2694
2911
  }
2695
2912
  while (s4 !== peg$FAILED) {
2696
2913
  s3.push(s4);
2697
2914
  s4 = input.charAt(peg$currPos);
2698
- if (peg$r13.test(s4)) peg$currPos++;
2915
+ if (peg$r15.test(s4)) peg$currPos++;
2699
2916
  else {
2700
2917
  s4 = peg$FAILED;
2701
- if (peg$silentFails === 0) peg$fail(peg$e29);
2918
+ if (peg$silentFails === 0) peg$fail(peg$e32);
2702
2919
  }
2703
2920
  }
2704
2921
  s2 = [s2, s3];
@@ -2722,10 +2939,10 @@ function peg$parse(input, options) {
2722
2939
  s6 = peg$currPos;
2723
2940
  peg$silentFails++;
2724
2941
  s7 = input.charAt(peg$currPos);
2725
- if (peg$r14.test(s7)) peg$currPos++;
2942
+ if (peg$r16.test(s7)) peg$currPos++;
2726
2943
  else {
2727
2944
  s7 = peg$FAILED;
2728
- if (peg$silentFails === 0) peg$fail(peg$e30);
2945
+ if (peg$silentFails === 0) peg$fail(peg$e33);
2729
2946
  }
2730
2947
  peg$silentFails--;
2731
2948
  if (s7 === peg$FAILED) s6 = void 0;
@@ -2758,10 +2975,10 @@ function peg$parse(input, options) {
2758
2975
  s6 = peg$currPos;
2759
2976
  peg$silentFails++;
2760
2977
  s7 = input.charAt(peg$currPos);
2761
- if (peg$r14.test(s7)) peg$currPos++;
2978
+ if (peg$r16.test(s7)) peg$currPos++;
2762
2979
  else {
2763
2980
  s7 = peg$FAILED;
2764
- if (peg$silentFails === 0) peg$fail(peg$e30);
2981
+ if (peg$silentFails === 0) peg$fail(peg$e33);
2765
2982
  }
2766
2983
  peg$silentFails--;
2767
2984
  if (s7 === peg$FAILED) s6 = void 0;
@@ -2794,25 +3011,25 @@ function peg$parse(input, options) {
2794
3011
  else s3 = s4;
2795
3012
  if (s3 !== peg$FAILED) {
2796
3013
  peg$savedPos = peg$currPos;
2797
- s4 = peg$f49(s2, s3);
3014
+ s4 = peg$f51(s2, s3);
2798
3015
  if (s4) s4 = void 0;
2799
3016
  else s4 = peg$FAILED;
2800
3017
  if (s4 !== peg$FAILED) {
2801
3018
  s5 = peg$currPos;
2802
3019
  s6 = peg$parse_();
2803
3020
  if (input.charCodeAt(peg$currPos) === 61) {
2804
- s7 = peg$c15;
3021
+ s7 = peg$c16;
2805
3022
  peg$currPos++;
2806
3023
  } else {
2807
3024
  s7 = peg$FAILED;
2808
- if (peg$silentFails === 0) peg$fail(peg$e31);
3025
+ if (peg$silentFails === 0) peg$fail(peg$e34);
2809
3026
  }
2810
3027
  if (s7 !== peg$FAILED) {
2811
3028
  peg$parse_();
2812
3029
  s9 = peg$parseAttrValue();
2813
3030
  if (s9 !== peg$FAILED) {
2814
3031
  peg$savedPos = s5;
2815
- s5 = peg$f50(s2, s3, s9);
3032
+ s5 = peg$f52(s2, s3, s9);
2816
3033
  } else {
2817
3034
  peg$currPos = s5;
2818
3035
  s5 = peg$FAILED;
@@ -2823,7 +3040,7 @@ function peg$parse(input, options) {
2823
3040
  }
2824
3041
  if (s5 === peg$FAILED) s5 = null;
2825
3042
  peg$savedPos = s0;
2826
- s0 = peg$f51(s2, s3, s5);
3043
+ s0 = peg$f53(s2, s3, s5);
2827
3044
  } else {
2828
3045
  peg$currPos = s0;
2829
3046
  s0 = peg$FAILED;
@@ -2838,11 +3055,11 @@ function peg$parse(input, options) {
2838
3055
  let s0, s1, s2, s3, s4, s5;
2839
3056
  s0 = peg$currPos;
2840
3057
  if (input.charCodeAt(peg$currPos) === 34) {
2841
- s1 = peg$c16;
3058
+ s1 = peg$c17;
2842
3059
  peg$currPos++;
2843
3060
  } else {
2844
3061
  s1 = peg$FAILED;
2845
- if (peg$silentFails === 0) peg$fail(peg$e32);
3062
+ if (peg$silentFails === 0) peg$fail(peg$e35);
2846
3063
  }
2847
3064
  if (s1 !== peg$FAILED) {
2848
3065
  s2 = peg$parseHere();
@@ -2851,10 +3068,10 @@ function peg$parse(input, options) {
2851
3068
  s5 = peg$parseValuePart();
2852
3069
  if (s5 === peg$FAILED) {
2853
3070
  s5 = input.charAt(peg$currPos);
2854
- if (peg$r15.test(s5)) peg$currPos++;
3071
+ if (peg$r17.test(s5)) peg$currPos++;
2855
3072
  else {
2856
3073
  s5 = peg$FAILED;
2857
- if (peg$silentFails === 0) peg$fail(peg$e33);
3074
+ if (peg$silentFails === 0) peg$fail(peg$e36);
2858
3075
  }
2859
3076
  }
2860
3077
  while (s5 !== peg$FAILED) {
@@ -2862,25 +3079,25 @@ function peg$parse(input, options) {
2862
3079
  s5 = peg$parseValuePart();
2863
3080
  if (s5 === peg$FAILED) {
2864
3081
  s5 = input.charAt(peg$currPos);
2865
- if (peg$r15.test(s5)) peg$currPos++;
3082
+ if (peg$r17.test(s5)) peg$currPos++;
2866
3083
  else {
2867
3084
  s5 = peg$FAILED;
2868
- if (peg$silentFails === 0) peg$fail(peg$e33);
3085
+ if (peg$silentFails === 0) peg$fail(peg$e36);
2869
3086
  }
2870
3087
  }
2871
3088
  }
2872
3089
  s3 = input.substring(s3, peg$currPos);
2873
3090
  s4 = peg$parseHere();
2874
3091
  if (input.charCodeAt(peg$currPos) === 34) {
2875
- s5 = peg$c16;
3092
+ s5 = peg$c17;
2876
3093
  peg$currPos++;
2877
3094
  } else {
2878
3095
  s5 = peg$FAILED;
2879
- if (peg$silentFails === 0) peg$fail(peg$e32);
3096
+ if (peg$silentFails === 0) peg$fail(peg$e35);
2880
3097
  }
2881
3098
  if (s5 !== peg$FAILED) {
2882
3099
  peg$savedPos = s0;
2883
- s0 = peg$f52(s2, s3, s4);
3100
+ s0 = peg$f54(s2, s3, s4);
2884
3101
  } else {
2885
3102
  peg$currPos = s0;
2886
3103
  s0 = peg$FAILED;
@@ -2892,11 +3109,11 @@ function peg$parse(input, options) {
2892
3109
  if (s0 === peg$FAILED) {
2893
3110
  s0 = peg$currPos;
2894
3111
  if (input.charCodeAt(peg$currPos) === 39) {
2895
- s1 = peg$c17;
3112
+ s1 = peg$c18;
2896
3113
  peg$currPos++;
2897
3114
  } else {
2898
3115
  s1 = peg$FAILED;
2899
- if (peg$silentFails === 0) peg$fail(peg$e34);
3116
+ if (peg$silentFails === 0) peg$fail(peg$e37);
2900
3117
  }
2901
3118
  if (s1 !== peg$FAILED) {
2902
3119
  s2 = peg$parseHere();
@@ -2905,10 +3122,10 @@ function peg$parse(input, options) {
2905
3122
  s5 = peg$parseValuePart();
2906
3123
  if (s5 === peg$FAILED) {
2907
3124
  s5 = input.charAt(peg$currPos);
2908
- if (peg$r16.test(s5)) peg$currPos++;
3125
+ if (peg$r18.test(s5)) peg$currPos++;
2909
3126
  else {
2910
3127
  s5 = peg$FAILED;
2911
- if (peg$silentFails === 0) peg$fail(peg$e35);
3128
+ if (peg$silentFails === 0) peg$fail(peg$e38);
2912
3129
  }
2913
3130
  }
2914
3131
  while (s5 !== peg$FAILED) {
@@ -2916,25 +3133,25 @@ function peg$parse(input, options) {
2916
3133
  s5 = peg$parseValuePart();
2917
3134
  if (s5 === peg$FAILED) {
2918
3135
  s5 = input.charAt(peg$currPos);
2919
- if (peg$r16.test(s5)) peg$currPos++;
3136
+ if (peg$r18.test(s5)) peg$currPos++;
2920
3137
  else {
2921
3138
  s5 = peg$FAILED;
2922
- if (peg$silentFails === 0) peg$fail(peg$e35);
3139
+ if (peg$silentFails === 0) peg$fail(peg$e38);
2923
3140
  }
2924
3141
  }
2925
3142
  }
2926
3143
  s3 = input.substring(s3, peg$currPos);
2927
3144
  s4 = peg$parseHere();
2928
3145
  if (input.charCodeAt(peg$currPos) === 39) {
2929
- s5 = peg$c17;
3146
+ s5 = peg$c18;
2930
3147
  peg$currPos++;
2931
3148
  } else {
2932
3149
  s5 = peg$FAILED;
2933
- if (peg$silentFails === 0) peg$fail(peg$e34);
3150
+ if (peg$silentFails === 0) peg$fail(peg$e37);
2934
3151
  }
2935
3152
  if (s5 !== peg$FAILED) {
2936
3153
  peg$savedPos = s0;
2937
- s0 = peg$f53(s2, s3, s4);
3154
+ s0 = peg$f55(s2, s3, s4);
2938
3155
  } else {
2939
3156
  peg$currPos = s0;
2940
3157
  s0 = peg$FAILED;
@@ -2946,14 +3163,14 @@ function peg$parse(input, options) {
2946
3163
  if (s0 === peg$FAILED) {
2947
3164
  s0 = peg$currPos;
2948
3165
  s1 = input.charAt(peg$currPos);
2949
- if (peg$r17.test(s1)) peg$currPos++;
3166
+ if (peg$r19.test(s1)) peg$currPos++;
2950
3167
  else {
2951
3168
  s1 = peg$FAILED;
2952
- if (peg$silentFails === 0) peg$fail(peg$e36);
3169
+ if (peg$silentFails === 0) peg$fail(peg$e39);
2953
3170
  }
2954
3171
  if (s1 !== peg$FAILED) {
2955
3172
  peg$savedPos = s0;
2956
- s1 = peg$f54(s1);
3173
+ s1 = peg$f56(s1);
2957
3174
  }
2958
3175
  s0 = s1;
2959
3176
  if (s0 === peg$FAILED) {
@@ -2962,24 +3179,24 @@ function peg$parse(input, options) {
2962
3179
  s2 = peg$currPos;
2963
3180
  s3 = [];
2964
3181
  s4 = input.charAt(peg$currPos);
2965
- if (peg$r18.test(s4)) peg$currPos++;
3182
+ if (peg$r20.test(s4)) peg$currPos++;
2966
3183
  else {
2967
3184
  s4 = peg$FAILED;
2968
- if (peg$silentFails === 0) peg$fail(peg$e37);
3185
+ if (peg$silentFails === 0) peg$fail(peg$e40);
2969
3186
  }
2970
3187
  while (s4 !== peg$FAILED) {
2971
3188
  s3.push(s4);
2972
3189
  s4 = input.charAt(peg$currPos);
2973
- if (peg$r18.test(s4)) peg$currPos++;
3190
+ if (peg$r20.test(s4)) peg$currPos++;
2974
3191
  else {
2975
3192
  s4 = peg$FAILED;
2976
- if (peg$silentFails === 0) peg$fail(peg$e37);
3193
+ if (peg$silentFails === 0) peg$fail(peg$e40);
2977
3194
  }
2978
3195
  }
2979
3196
  s2 = input.substring(s2, peg$currPos);
2980
3197
  s3 = peg$parseHere();
2981
3198
  peg$savedPos = s0;
2982
- s0 = peg$f55(s1, s2, s3);
3199
+ s0 = peg$f57(s1, s2, s3);
2983
3200
  }
2984
3201
  }
2985
3202
  }
@@ -2989,7 +3206,7 @@ function peg$parse(input, options) {
2989
3206
  let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
2990
3207
  s0 = peg$currPos;
2991
3208
  peg$savedPos = peg$currPos;
2992
- s1 = peg$f56();
3209
+ s1 = peg$f58();
2993
3210
  if (s1) s1 = void 0;
2994
3211
  else s1 = peg$FAILED;
2995
3212
  if (s1 !== peg$FAILED) {
@@ -3018,7 +3235,7 @@ function peg$parse(input, options) {
3018
3235
  if (s2 !== peg$FAILED) {
3019
3236
  s3 = peg$currPos;
3020
3237
  peg$savedPos = peg$currPos;
3021
- s4 = peg$f57(s2);
3238
+ s4 = peg$f59(s2);
3022
3239
  if (s4) s4 = void 0;
3023
3240
  else s4 = peg$FAILED;
3024
3241
  if (s4 !== peg$FAILED) {
@@ -3057,7 +3274,7 @@ function peg$parse(input, options) {
3057
3274
  if (s0 === peg$FAILED) {
3058
3275
  s0 = peg$currPos;
3059
3276
  peg$savedPos = peg$currPos;
3060
- s1 = peg$f58();
3277
+ s1 = peg$f60();
3061
3278
  if (s1) s1 = void 0;
3062
3279
  else s1 = peg$FAILED;
3063
3280
  if (s1 !== peg$FAILED) {
@@ -3084,12 +3301,12 @@ function peg$parse(input, options) {
3084
3301
  if (s6 !== peg$FAILED) {
3085
3302
  s7 = peg$parseHere();
3086
3303
  peg$savedPos = peg$currPos;
3087
- s8 = peg$f59(s4, s7);
3304
+ s8 = peg$f61(s4, s7);
3088
3305
  if (s8) s8 = void 0;
3089
3306
  else s8 = peg$FAILED;
3090
3307
  if (s8 !== peg$FAILED) {
3091
3308
  s9 = peg$currPos;
3092
- s10 = peg$f60(s4, s7);
3309
+ s10 = peg$f62(s4, s7);
3093
3310
  s11 = peg$currPos;
3094
3311
  s12 = [];
3095
3312
  if (s12.length >= (s10 | 0)) s13 = peg$FAILED;
@@ -3171,7 +3388,7 @@ function peg$parse(input, options) {
3171
3388
  if (s0 === peg$FAILED) {
3172
3389
  s0 = peg$currPos;
3173
3390
  peg$savedPos = peg$currPos;
3174
- s1 = peg$f61();
3391
+ s1 = peg$f63();
3175
3392
  if (s1) s1 = void 0;
3176
3393
  else s1 = peg$FAILED;
3177
3394
  if (s1 !== peg$FAILED) {
@@ -3262,7 +3479,7 @@ function peg$parse(input, options) {
3262
3479
  if (s0 === peg$FAILED) {
3263
3480
  s0 = peg$currPos;
3264
3481
  peg$savedPos = peg$currPos;
3265
- s1 = peg$f62();
3482
+ s1 = peg$f64();
3266
3483
  if (s1) s1 = void 0;
3267
3484
  else s1 = peg$FAILED;
3268
3485
  if (s1 !== peg$FAILED) {
@@ -3344,10 +3561,10 @@ function peg$parse(input, options) {
3344
3561
  function peg$parse_c() {
3345
3562
  let s0;
3346
3563
  s0 = input.charAt(peg$currPos);
3347
- if (peg$r19.test(s0)) peg$currPos++;
3564
+ if (peg$r21.test(s0)) peg$currPos++;
3348
3565
  else {
3349
3566
  s0 = peg$FAILED;
3350
- if (peg$silentFails === 0) peg$fail(peg$e38);
3567
+ if (peg$silentFails === 0) peg$fail(peg$e41);
3351
3568
  }
3352
3569
  return s0;
3353
3570
  }
@@ -24175,12 +24392,30 @@ function markdownOptions(options) {
24175
24392
  };
24176
24393
  }
24177
24394
  //#endregion
24178
- //#region src/format/fenced-code.ts
24179
- /** Source lines that belong to a fenced block in a runtime Markdown document. */
24180
- function fencedCodeLines(source, isBlock) {
24395
+ //#region src/format/source-lines.ts
24396
+ /** Index a source once; locate zero-based lines without rescanning its prefixes. */
24397
+ function sourceLines(source) {
24398
+ const starts = [0];
24399
+ for (let i = 0; i < source.length; i++) if (source[i] === "\n") starts.push(i + 1);
24400
+ return (offset) => {
24401
+ let low = 0;
24402
+ let high = starts.length;
24403
+ while (low < high) {
24404
+ const middle = low + high >>> 1;
24405
+ if (starts[middle] <= offset) low = middle + 1;
24406
+ else high = middle;
24407
+ }
24408
+ return Math.max(0, low - 1);
24409
+ };
24410
+ }
24411
+ //#endregion
24412
+ //#region src/format/markdown-lines.ts
24413
+ /** Source lines belonging to the given constructs in runtime Markdown documents. */
24414
+ function markdownLines(source, isBlock, types) {
24181
24415
  const found = /* @__PURE__ */ new Set();
24182
- if (!/`{3}|~{3}/.test(source)) return found;
24416
+ if (types.size === 1 && types.has("codeFenced") && !/`{3}|~{3}/.test(source)) return found;
24183
24417
  const { nodes } = analyzeMarkup(source, { hooks: { isBlock } });
24418
+ const lineAt = sourceLines(source);
24184
24419
  function visit(nodes) {
24185
24420
  let markdown = "";
24186
24421
  const spans = [];
@@ -24192,23 +24427,32 @@ function fencedCodeLines(source, isBlock) {
24192
24427
  end: markdown.length,
24193
24428
  node
24194
24429
  });
24195
- if (node.body && !(node.token.type === "macro" && node.token.name === "do")) {
24430
+ if (node.body && !(node.token.type === "macro" && node.token.name.toLowerCase() === "do")) {
24196
24431
  visit(node.body.children);
24197
24432
  for (const branch of node.body.branches) visit(branch.children);
24198
24433
  }
24199
24434
  }
24200
24435
  const events = postprocess(parse(markdownOptions()).document().write(preprocess()(markdown, void 0, true)));
24201
24436
  for (const [event, token] of events) {
24202
- if (event !== "enter" || token.type !== "codeFenced") continue;
24203
- for (const span of spans) {
24437
+ if (event !== "enter" || !types.has(token.type)) continue;
24438
+ let low = 0;
24439
+ let high = spans.length;
24440
+ while (low < high) {
24441
+ const middle = low + high >>> 1;
24442
+ if (spans[middle].end <= token.start.offset) low = middle + 1;
24443
+ else high = middle;
24444
+ }
24445
+ for (let i = low; i < spans.length; i++) {
24446
+ const span = spans[i];
24447
+ if (span.start >= token.end.offset) break;
24204
24448
  const start = Math.max(token.start.offset, span.start);
24205
24449
  const end = Math.min(token.end.offset, span.end);
24206
24450
  if (start >= end) continue;
24207
24451
  const text = span.node.token.type === "text";
24208
24452
  const a = text ? span.node.start + start - span.start : span.node.start;
24209
24453
  const b = text ? span.node.start + end - span.start : span.node.end;
24210
- const first = source.slice(0, a).split("\n").length - 1;
24211
- const last = source.slice(0, Math.max(a, b - 1)).split("\n").length - 1;
24454
+ const first = lineAt(a);
24455
+ const last = lineAt(Math.max(a, b - 1));
24212
24456
  for (let line = first; line <= last; line++) found.add(line);
24213
24457
  }
24214
24458
  }
@@ -24280,7 +24524,7 @@ function scanSpindleMarkup(text) {
24280
24524
  }, true);
24281
24525
  }
24282
24526
  } else if (t.type !== "text") {
24283
- if (t.type === "macro" && t.name === "do") {
24527
+ if (t.type === "macro" && t.name.toLowerCase() === "do") {
24284
24528
  if (!t.isClose) open = t;
24285
24529
  else if (open) {
24286
24530
  doBlocks.push({
@@ -24571,7 +24815,7 @@ async function formatLf(text, options) {
24571
24815
  const literalSentinel = newlineSentinel(body + sentinel);
24572
24816
  const literalLines = /* @__PURE__ */ new Map();
24573
24817
  const literalMarkers = /* @__PURE__ */ new Set();
24574
- const fenced = fencedCodeLines(body, isBlock);
24818
+ const fenced = markdownLines(body, isBlock, /* @__PURE__ */ new Set(["codeFenced"]));
24575
24819
  const literalHtml = whitespaceSensitiveLines(body, isBlock);
24576
24820
  body = body.split("\n").map((line, index) => {
24577
24821
  if (!fenced.has(index) && !literalHtml.has(index)) return line;
@@ -24626,7 +24870,7 @@ async function formatLf(text, options) {
24626
24870
  continue;
24627
24871
  }
24628
24872
  let indented = indentMacros(region.lines, isBlock, isDedenting, literalMarkers);
24629
- if (options.maxLineLength) indented = wrapLines(indented, options.maxLineLength, literalLines);
24873
+ if (options.maxLineLength) indented = wrapLines(indented, options.maxLineLength, literalLines, isBlock);
24630
24874
  for (const line of indented) {
24631
24875
  if (line.endsWith(" ")) hardBreakLines.add(lines.length);
24632
24876
  lines.push(line);
@@ -24642,13 +24886,14 @@ var WHITESPACE_AS_WRITTEN = /<(?:pre|textarea)[\s>]|white-space\s*:/i;
24642
24886
  function whitespaceSensitiveLines(source, isBlock) {
24643
24887
  const lines = /* @__PURE__ */ new Set();
24644
24888
  if (!WHITESPACE_AS_WRITTEN.test(source)) return lines;
24889
+ const lineAt = sourceLines(source);
24645
24890
  const { nodes } = analyzeMarkup(source, { hooks: { isBlock } });
24646
24891
  function visit(nodes) {
24647
24892
  for (const node of nodes) {
24648
24893
  const { token, body } = node;
24649
24894
  if (token.type === "html" && (["pre", "textarea"].includes(token.tag.toLowerCase()) || Object.entries(token.attributes).some(([name, value]) => name.toLowerCase() === "style" && /white-space\s*:/i.test(value)))) {
24650
- const first = source.slice(0, node.start).split("\n").length - 1;
24651
- const last = source.slice(0, node.end - 1).split("\n").length - 1;
24895
+ const first = lineAt(node.start);
24896
+ const last = lineAt(node.end - 1);
24652
24897
  for (let line = first; line <= last; line++) lines.add(line);
24653
24898
  } else if (body) {
24654
24899
  visit(body.children);
@@ -24801,16 +25046,31 @@ function indentColumn(line) {
24801
25046
  else break;
24802
25047
  return col;
24803
25048
  }
25049
+ /** Constructs whose line breaks or continuation prefixes carry Markdown syntax. */
25050
+ var NO_WRAP = /* @__PURE__ */ new Set([
25051
+ "atxHeading",
25052
+ "setextHeading",
25053
+ "table",
25054
+ "listItem",
25055
+ "blockQuote",
25056
+ "definition",
25057
+ "thematicBreak",
25058
+ "htmlFlow",
25059
+ "codeText",
25060
+ "link",
25061
+ "image"
25062
+ ]);
24804
25063
  /**
24805
25064
  * Wrap lines that exceed maxLen at word boundaries.
24806
25065
  * Preserves leading indentation. Skips pure macro lines and choice/link
24807
25066
  * lines, where wrapping would break syntax.
24808
25067
  */
24809
- function wrapLines(lines, maxLen, literalLines) {
25068
+ function wrapLines(lines, maxLen, literalLines, isBlock) {
24810
25069
  const result = [];
24811
25070
  const javaScript = doBodyLines(lines);
25071
+ const structured = markdownLines(lines.join("\n"), isBlock, NO_WRAP);
24812
25072
  for (const [index, line] of lines.entries()) {
24813
- if (line.length <= maxLen || javaScript.has(index) || literalLines.has(line.trim())) {
25073
+ if (line.length <= maxLen || javaScript.has(index) || structured.has(index) || literalLines.has(line.trim())) {
24814
25074
  result.push(line);
24815
25075
  continue;
24816
25076
  }
@@ -24829,9 +25089,10 @@ function wrapLines(lines, maxLen, literalLines) {
24829
25089
  function doBodyLines(lines) {
24830
25090
  const found = /* @__PURE__ */ new Set();
24831
25091
  const text = lines.join("\n");
25092
+ const lineAt = sourceLines(text);
24832
25093
  for (const block of scanSpindleMarkup(text).doBlocks) {
24833
- const first = text.slice(0, block.bodyStart).split("\n").length - 1;
24834
- const last = text.slice(0, block.bodyEnd).split("\n").length - 1;
25094
+ const first = lineAt(block.bodyStart);
25095
+ const last = lineAt(block.bodyEnd);
24835
25096
  for (let i = first; i <= last; i++) found.add(i);
24836
25097
  }
24837
25098
  return found;