markdown-to-html-cli 3.2.13 → 3.2.14

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.
@@ -0,0 +1,1047 @@
1
+ import { Element, ElementContent } from 'hast';
2
+
3
+ /**
4
+ * @wcj/markdown-to-html@2.0.1
5
+ * https://github.com/jaywcjlove/markdown-to-html
6
+ */
7
+ const scriptString = `
8
+ const __TEMPLATE__ = document.createElement('template');
9
+ __TEMPLATE__.innerHTML = \`
10
+ <style>
11
+ :host [data-color-mode*='light'] {
12
+ --color-prettylights-syntax-comment: #6e7781;
13
+ --color-prettylights-syntax-constant: #0550ae;
14
+ --color-prettylights-syntax-entity: #8250df;
15
+ --color-prettylights-syntax-storage-modifier-import: #24292f;
16
+ --color-prettylights-syntax-entity-tag: #116329;
17
+ --color-prettylights-syntax-keyword: #cf222e;
18
+ --color-prettylights-syntax-string: #0a3069;
19
+ --color-prettylights-syntax-variable: #953800;
20
+ --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
21
+ --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
22
+ --color-prettylights-syntax-invalid-illegal-bg: #82071e;
23
+ --color-prettylights-syntax-carriage-return-text: #f6f8fa;
24
+ --color-prettylights-syntax-carriage-return-bg: #cf222e;
25
+ --color-prettylights-syntax-string-regexp: #116329;
26
+ --color-prettylights-syntax-markup-list: #3b2300;
27
+ --color-prettylights-syntax-markup-heading: #0550ae;
28
+ --color-prettylights-syntax-markup-italic: #24292f;
29
+ --color-prettylights-syntax-markup-bold: #24292f;
30
+ --color-prettylights-syntax-markup-deleted-text: #82071e;
31
+ --color-prettylights-syntax-markup-deleted-bg: #FFEBE9;
32
+ --color-prettylights-syntax-markup-inserted-text: #116329;
33
+ --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
34
+ --color-prettylights-syntax-markup-changed-text: #953800;
35
+ --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
36
+ --color-prettylights-syntax-markup-ignored-text: #eaeef2;
37
+ --color-prettylights-syntax-markup-ignored-bg: #0550ae;
38
+ --color-prettylights-syntax-meta-diff-range: #8250df;
39
+ --color-prettylights-syntax-brackethighlighter-angle: #57606a;
40
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
41
+ --color-prettylights-syntax-constant-other-reference-link: #0a3069;
42
+ --color-fg-default: #24292f;
43
+ --color-fg-muted: #57606a;
44
+ --color-fg-subtle: #6e7781;
45
+ --color-canvas-default: #ffffff;
46
+ --color-canvas-subtle: #f6f8fa;
47
+ --color-border-default: #d0d7de;
48
+ --color-border-muted: hsla(210,18%,87%,1);
49
+ --color-neutral-muted: rgba(175,184,193,0.2);
50
+ --color-accent-fg: #0969da;
51
+ --color-accent-emphasis: #0969da;
52
+ --color-attention-subtle: #fff8c5;
53
+ --color-danger-fg: #cf222e;
54
+ }
55
+ :host [data-color-mode*='dark'] {
56
+ --color-prettylights-syntax-comment: #8b949e;
57
+ --color-prettylights-syntax-constant: #79c0ff;
58
+ --color-prettylights-syntax-entity: #d2a8ff;
59
+ --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
60
+ --color-prettylights-syntax-entity-tag: #7ee787;
61
+ --color-prettylights-syntax-keyword: #ff7b72;
62
+ --color-prettylights-syntax-string: #a5d6ff;
63
+ --color-prettylights-syntax-variable: #ffa657;
64
+ --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
65
+ --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
66
+ --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
67
+ --color-prettylights-syntax-carriage-return-text: #f0f6fc;
68
+ --color-prettylights-syntax-carriage-return-bg: #b62324;
69
+ --color-prettylights-syntax-string-regexp: #7ee787;
70
+ --color-prettylights-syntax-markup-list: #f2cc60;
71
+ --color-prettylights-syntax-markup-heading: #1f6feb;
72
+ --color-prettylights-syntax-markup-italic: #c9d1d9;
73
+ --color-prettylights-syntax-markup-bold: #c9d1d9;
74
+ --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
75
+ --color-prettylights-syntax-markup-deleted-bg: #67060c;
76
+ --color-prettylights-syntax-markup-inserted-text: #aff5b4;
77
+ --color-prettylights-syntax-markup-inserted-bg: #033a16;
78
+ --color-prettylights-syntax-markup-changed-text: #ffdfb6;
79
+ --color-prettylights-syntax-markup-changed-bg: #5a1e02;
80
+ --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
81
+ --color-prettylights-syntax-markup-ignored-bg: #1158c7;
82
+ --color-prettylights-syntax-meta-diff-range: #d2a8ff;
83
+ --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
84
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
85
+ --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
86
+ --color-fg-default: #c9d1d9;
87
+ --color-fg-muted: #8b949e;
88
+ --color-fg-subtle: #484f58;
89
+ --color-canvas-default: #0d1117;
90
+ --color-canvas-subtle: #161b22;
91
+ --color-border-default: #30363d;
92
+ --color-border-muted: #21262d;
93
+ --color-neutral-muted: rgba(110,118,129,0.4);
94
+ --color-accent-fg: #58a6ff;
95
+ --color-accent-emphasis: #1f6feb;
96
+ --color-attention-subtle: rgba(187,128,9,0.15);
97
+ --color-danger-fg: #f85149;
98
+ }
99
+
100
+ .markdown-body {
101
+ -webkit-text-size-adjust: 100%;
102
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
103
+ font-size: 16px;
104
+ line-height: 1.5;
105
+ word-wrap: break-word;
106
+ color: var(--color-fg-default);
107
+ background-color: var(--color-canvas-default);
108
+ }
109
+
110
+ :host details,
111
+ :host figcaption,
112
+ :host figure {
113
+ display: block;
114
+ }
115
+
116
+ :host summary {
117
+ display: list-item;
118
+ }
119
+
120
+ :host [hidden] {
121
+ display: none !important;
122
+ }
123
+
124
+ :host a {
125
+ background-color: transparent;
126
+ color: var(--color-accent-fg);
127
+ text-decoration: none;
128
+ }
129
+
130
+ :host a:active,
131
+ :host a:hover {
132
+ outline-width: 0;
133
+ }
134
+
135
+ :host abbr[title] {
136
+ border-bottom: none;
137
+ text-decoration: underline dotted;
138
+ }
139
+
140
+ :host b,
141
+ :host strong {
142
+ font-weight: 600;
143
+ }
144
+
145
+ :host dfn {
146
+ font-style: italic;
147
+ }
148
+
149
+ :host h1 {
150
+ margin: .67em 0;
151
+ font-weight: 600;
152
+ padding-bottom: .3em;
153
+ font-size: 2em;
154
+ border-bottom: 1px solid var(--color-border-muted);
155
+ }
156
+
157
+ :host mark {
158
+ background-color: var(--color-attention-subtle);
159
+ color: var(--color-text-primary);
160
+ }
161
+
162
+ :host small {
163
+ font-size: 90%;
164
+ }
165
+
166
+ :host sub,
167
+ :host sup {
168
+ font-size: 75%;
169
+ line-height: 0;
170
+ position: relative;
171
+ vertical-align: baseline;
172
+ }
173
+
174
+ :host sub {
175
+ bottom: -0.25em;
176
+ }
177
+
178
+ :host sup {
179
+ top: -0.5em;
180
+ }
181
+
182
+ :host img {
183
+ border-style: none;
184
+ max-width: 100%;
185
+ box-sizing: content-box;
186
+ background-color: var(--color-canvas-default);
187
+ }
188
+
189
+ :host code,
190
+ :host kbd,
191
+ :host pre,
192
+ :host samp {
193
+ font-family: monospace,monospace;
194
+ font-size: 1em;
195
+ }
196
+
197
+ :host figure {
198
+ margin: 1em 40px;
199
+ }
200
+
201
+ :host hr {
202
+ box-sizing: content-box;
203
+ overflow: hidden;
204
+ background: transparent;
205
+ border-bottom: 1px solid var(--color-border-muted);
206
+ height: .25em;
207
+ padding: 0;
208
+ margin: 24px 0;
209
+ background-color: var(--color-border-default);
210
+ border: 0;
211
+ }
212
+
213
+ :host input {
214
+ font: inherit;
215
+ margin: 0;
216
+ overflow: visible;
217
+ font-family: inherit;
218
+ font-size: inherit;
219
+ line-height: inherit;
220
+ }
221
+
222
+ :host [type=button],
223
+ :host [type=reset],
224
+ :host [type=submit] {
225
+ -webkit-appearance: button;
226
+ }
227
+
228
+ :host [type=button]::-moz-focus-inner,
229
+ :host [type=reset]::-moz-focus-inner,
230
+ :host [type=submit]::-moz-focus-inner {
231
+ border-style: none;
232
+ padding: 0;
233
+ }
234
+
235
+ :host [type=button]:-moz-focusring,
236
+ :host [type=reset]:-moz-focusring,
237
+ :host [type=submit]:-moz-focusring {
238
+ outline: 1px dotted ButtonText;
239
+ }
240
+
241
+ :host [type=checkbox],
242
+ :host [type=radio] {
243
+ box-sizing: border-box;
244
+ padding: 0;
245
+ }
246
+
247
+ :host [type=number]::-webkit-inner-spin-button,
248
+ :host [type=number]::-webkit-outer-spin-button {
249
+ height: auto;
250
+ }
251
+
252
+ :host [type=search] {
253
+ -webkit-appearance: textfield;
254
+ outline-offset: -2px;
255
+ }
256
+
257
+ :host [type=search]::-webkit-search-cancel-button,
258
+ :host [type=search]::-webkit-search-decoration {
259
+ -webkit-appearance: none;
260
+ }
261
+
262
+ :host ::-webkit-input-placeholder {
263
+ color: inherit;
264
+ opacity: .54;
265
+ }
266
+
267
+ :host ::-webkit-file-upload-button {
268
+ -webkit-appearance: button;
269
+ font: inherit;
270
+ }
271
+
272
+ :host a:hover {
273
+ text-decoration: underline;
274
+ }
275
+
276
+ :host hr::before {
277
+ display: table;
278
+ content: "";
279
+ }
280
+
281
+ :host hr::after {
282
+ display: table;
283
+ clear: both;
284
+ content: "";
285
+ }
286
+
287
+ :host table {
288
+ border-spacing: 0;
289
+ border-collapse: collapse;
290
+ display: block;
291
+ width: max-content;
292
+ max-width: 100%;
293
+ overflow: auto;
294
+ }
295
+
296
+ :host td,
297
+ :host th {
298
+ padding: 0;
299
+ }
300
+
301
+ :host details summary {
302
+ cursor: pointer;
303
+ }
304
+
305
+ :host details:not([open])>*:not(summary) {
306
+ display: none !important;
307
+ }
308
+
309
+ :host kbd {
310
+ display: inline-block;
311
+ padding: 3px 5px;
312
+ font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
313
+ line-height: 10px;
314
+ color: var(--color-fg-default);
315
+ vertical-align: middle;
316
+ background-color: var(--color-canvas-subtle);
317
+ border: solid 1px var(--color-neutral-muted);
318
+ border-bottom-color: var(--color-neutral-muted);
319
+ border-radius: 6px;
320
+ box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
321
+ }
322
+
323
+ :host h1,
324
+ :host h2,
325
+ :host h3,
326
+ :host h4,
327
+ :host h5,
328
+ :host h6 {
329
+ margin-top: 24px;
330
+ margin-bottom: 16px;
331
+ font-weight: 600;
332
+ line-height: 1.25;
333
+ }
334
+
335
+ :host h2 {
336
+ font-weight: 600;
337
+ padding-bottom: .3em;
338
+ font-size: 1.5em;
339
+ border-bottom: 1px solid var(--color-border-muted);
340
+ }
341
+
342
+ :host h3 {
343
+ font-weight: 600;
344
+ font-size: 1.25em;
345
+ }
346
+
347
+ :host h4 {
348
+ font-weight: 600;
349
+ font-size: 1em;
350
+ }
351
+
352
+ :host h5 {
353
+ font-weight: 600;
354
+ font-size: .875em;
355
+ }
356
+
357
+ :host h6 {
358
+ font-weight: 600;
359
+ font-size: .85em;
360
+ color: var(--color-fg-muted);
361
+ }
362
+
363
+ :host p {
364
+ margin-top: 0;
365
+ margin-bottom: 10px;
366
+ }
367
+
368
+ :host blockquote {
369
+ margin: 0;
370
+ padding: 0 1em;
371
+ color: var(--color-fg-muted);
372
+ border-left: .25em solid var(--color-border-default);
373
+ }
374
+
375
+ :host ul,
376
+ :host ol {
377
+ margin-top: 0;
378
+ margin-bottom: 0;
379
+ padding-left: 2em;
380
+ }
381
+
382
+ :host ol ol,
383
+ :host ul ol {
384
+ list-style-type: lower-roman;
385
+ }
386
+
387
+ :host ul ul ol,
388
+ :host ul ol ol,
389
+ :host ol ul ol,
390
+ :host ol ol ol {
391
+ list-style-type: lower-alpha;
392
+ }
393
+
394
+ :host dd {
395
+ margin-left: 0;
396
+ }
397
+
398
+ :host tt,
399
+ :host code {
400
+ font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
401
+ font-size: 12px;
402
+ }
403
+
404
+ :host pre {
405
+ margin-top: 0;
406
+ margin-bottom: 0;
407
+ font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
408
+ font-size: 12px;
409
+ word-wrap: normal;
410
+ }
411
+
412
+ :host .octicon {
413
+ display: inline-block;
414
+ overflow: visible !important;
415
+ vertical-align: text-bottom;
416
+ fill: currentColor;
417
+ }
418
+
419
+ :host ::placeholder {
420
+ color: var(--color-fg-subtle);
421
+ opacity: 1;
422
+ }
423
+
424
+ :host input::-webkit-outer-spin-button,
425
+ :host input::-webkit-inner-spin-button {
426
+ margin: 0;
427
+ -webkit-appearance: none;
428
+ appearance: none;
429
+ }
430
+
431
+ .token.comment, .token.prolog, .token.doctype, .token.cdata {
432
+ color: var(--color-prettylights-syntax-comment);
433
+ }
434
+ .token.namespace { opacity: 0.7; }
435
+ .token.tag, .token.selector, .token.constant, .token.symbol, .token.deleted {
436
+ color: var(--color-prettylights-syntax-entity-tag);
437
+ }
438
+ .token.maybe-class-name {
439
+ color: var(--color-prettylights-syntax-variable);
440
+ }
441
+ .token.property-access, .token.operator, .token.boolean, .token.number, .token.selector .token.class, .token.attr-name, .token.string, .token.char, .token.builtin {
442
+ color: var(--color-prettylights-syntax-constant);
443
+ }
444
+
445
+ .token.deleted {
446
+ color: var(--color-prettylights-syntax-markup-deleted-text);
447
+ }
448
+ .token.property {
449
+ color: var(--color-prettylights-syntax-constant);
450
+ }
451
+ .token.punctuation {
452
+ color: var(--color-prettylights-syntax-markup-bold);
453
+ }
454
+ .token.function {
455
+ color: var(--color-prettylights-syntax-entity);
456
+ }
457
+ .code-line .token.deleted {
458
+ background-color: var(--color-prettylights-syntax-markup-deleted-bg);
459
+ }
460
+ .token.inserted {
461
+ color: var(--color-prettylights-syntax-markup-inserted-text);
462
+ }
463
+ .code-line .token.inserted {
464
+ background-color: var(--color-prettylights-syntax-markup-inserted-bg);
465
+ }
466
+
467
+ .token.variable {
468
+ color: var(--color-prettylights-syntax-constant);
469
+ }
470
+ .token.entity, .token.url, .language-css .token.string, .style .token.string {
471
+ color: var(--color-prettylights-syntax-string);
472
+ }
473
+ .token.color, .token.atrule, .token.attr-value, .token.function, .token.class-name {
474
+ color: var(--color-prettylights-syntax-string);
475
+ }
476
+ .token.rule, .token.regex, .token.important, .token.keyword {
477
+ color: var(--color-prettylights-syntax-keyword);
478
+ }
479
+ .token.coord {
480
+ color: var(--color-prettylights-syntax-meta-diff-range);
481
+ }
482
+ .token.important, .token.bold { font-weight: bold; }
483
+ .token.italic { font-style: italic; }
484
+ .token.entity { cursor: help; }
485
+
486
+ :host [data-catalyst] {
487
+ display: block;
488
+ }
489
+
490
+ :host g-emoji {
491
+ font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
492
+ font-size: 1em;
493
+ font-style: normal !important;
494
+ font-weight: 400;
495
+ line-height: 1;
496
+ vertical-align: -0.075em;
497
+ }
498
+
499
+ :host g-emoji img {
500
+ width: 1em;
501
+ height: 1em;
502
+ }
503
+
504
+ .markdown-body::before {
505
+ display: table;
506
+ content: "";
507
+ }
508
+
509
+ .markdown-body::after {
510
+ display: table;
511
+ clear: both;
512
+ content: "";
513
+ }
514
+
515
+ .markdown-body>*:first-child {
516
+ margin-top: 0 !important;
517
+ }
518
+
519
+ .markdown-body>*:last-child {
520
+ margin-bottom: 0 !important;
521
+ }
522
+
523
+ :host a:not([href]) {
524
+ color: inherit;
525
+ text-decoration: none;
526
+ }
527
+
528
+ :host .absent {
529
+ color: var(--color-danger-fg);
530
+ }
531
+
532
+ :host .anchor {
533
+ float: left;
534
+ padding-right: 4px;
535
+ margin-left: -20px;
536
+ line-height: 1;
537
+ }
538
+
539
+ :host .anchor:focus {
540
+ outline: none;
541
+ }
542
+
543
+ :host p,
544
+ :host blockquote,
545
+ :host ul,
546
+ :host ol,
547
+ :host dl,
548
+ :host table,
549
+ :host pre,
550
+ :host details {
551
+ margin-top: 0;
552
+ margin-bottom: 16px;
553
+ }
554
+
555
+ :host blockquote>:first-child {
556
+ margin-top: 0;
557
+ }
558
+
559
+ :host blockquote>:last-child {
560
+ margin-bottom: 0;
561
+ }
562
+
563
+ :host sup>a::before {
564
+ content: "[";
565
+ }
566
+
567
+ :host sup>a::after {
568
+ content: "]";
569
+ }
570
+
571
+ :host h1 .octicon-link,
572
+ :host h2 .octicon-link,
573
+ :host h3 .octicon-link,
574
+ :host h4 .octicon-link,
575
+ :host h5 .octicon-link,
576
+ :host h6 .octicon-link {
577
+ color: var(--color-fg-default);
578
+ vertical-align: middle;
579
+ visibility: hidden;
580
+ }
581
+
582
+ :host h1:hover .anchor,
583
+ :host h2:hover .anchor,
584
+ :host h3:hover .anchor,
585
+ :host h4:hover .anchor,
586
+ :host h5:hover .anchor,
587
+ :host h6:hover .anchor {
588
+ text-decoration: none;
589
+ }
590
+
591
+ :host h1:hover .anchor .octicon-link,
592
+ :host h2:hover .anchor .octicon-link,
593
+ :host h3:hover .anchor .octicon-link,
594
+ :host h4:hover .anchor .octicon-link,
595
+ :host h5:hover .anchor .octicon-link,
596
+ :host h6:hover .anchor .octicon-link {
597
+ visibility: visible;
598
+ }
599
+
600
+ :host h1 tt,
601
+ :host h1 code,
602
+ :host h2 tt,
603
+ :host h2 code,
604
+ :host h3 tt,
605
+ :host h3 code,
606
+ :host h4 tt,
607
+ :host h4 code,
608
+ :host h5 tt,
609
+ :host h5 code,
610
+ :host h6 tt,
611
+ :host h6 code {
612
+ padding: 0 .2em;
613
+ font-size: inherit;
614
+ }
615
+
616
+ :host ul.no-list,
617
+ :host ol.no-list {
618
+ padding: 0;
619
+ list-style-type: none;
620
+ }
621
+
622
+ :host ol[type="1"] {
623
+ list-style-type: decimal;
624
+ }
625
+
626
+ :host ol[type=a] {
627
+ list-style-type: lower-alpha;
628
+ }
629
+
630
+ :host ol[type=i] {
631
+ list-style-type: lower-roman;
632
+ }
633
+
634
+ :host div>ol:not([type]) {
635
+ list-style-type: decimal;
636
+ }
637
+
638
+ :host ul ul,
639
+ :host ul ol,
640
+ :host ol ol,
641
+ :host ol ul {
642
+ margin-top: 0;
643
+ margin-bottom: 0;
644
+ }
645
+
646
+ :host li>p {
647
+ margin-top: 16px;
648
+ }
649
+
650
+ :host li+li {
651
+ margin-top: .25em;
652
+ }
653
+
654
+ :host dl {
655
+ padding: 0;
656
+ }
657
+
658
+ :host dl dt {
659
+ padding: 0;
660
+ margin-top: 16px;
661
+ font-size: 1em;
662
+ font-style: italic;
663
+ font-weight: 600;
664
+ }
665
+
666
+ :host dl dd {
667
+ padding: 0 16px;
668
+ margin-bottom: 16px;
669
+ }
670
+
671
+ :host table th {
672
+ font-weight: 600;
673
+ }
674
+
675
+ :host table th,
676
+ :host table td {
677
+ padding: 6px 13px;
678
+ border: 1px solid var(--color-border-default);
679
+ }
680
+
681
+ :host table tr {
682
+ background-color: var(--color-canvas-default);
683
+ border-top: 1px solid var(--color-border-muted);
684
+ }
685
+
686
+ :host table tr:nth-child(2n) {
687
+ background-color: var(--color-canvas-subtle);
688
+ }
689
+
690
+ :host table img {
691
+ background-color: transparent;
692
+ }
693
+
694
+ :host img[align=right] {
695
+ padding-left: 20px;
696
+ }
697
+
698
+ :host img[align=left] {
699
+ padding-right: 20px;
700
+ }
701
+
702
+ :host .emoji {
703
+ max-width: none;
704
+ vertical-align: text-top;
705
+ background-color: transparent;
706
+ }
707
+
708
+ :host span.frame {
709
+ display: block;
710
+ overflow: hidden;
711
+ }
712
+
713
+ :host span.frame>span {
714
+ display: block;
715
+ float: left;
716
+ width: auto;
717
+ padding: 7px;
718
+ margin: 13px 0 0;
719
+ overflow: hidden;
720
+ border: 1px solid var(--color-border-default);
721
+ }
722
+
723
+ :host span.frame span img {
724
+ display: block;
725
+ float: left;
726
+ }
727
+
728
+ :host span.frame span span {
729
+ display: block;
730
+ padding: 5px 0 0;
731
+ clear: both;
732
+ color: var(--color-fg-default);
733
+ }
734
+
735
+ :host span.align-center {
736
+ display: block;
737
+ overflow: hidden;
738
+ clear: both;
739
+ }
740
+
741
+ :host span.align-center>span {
742
+ display: block;
743
+ margin: 13px auto 0;
744
+ overflow: hidden;
745
+ text-align: center;
746
+ }
747
+
748
+ :host span.align-center span img {
749
+ margin: 0 auto;
750
+ text-align: center;
751
+ }
752
+
753
+ :host span.align-right {
754
+ display: block;
755
+ overflow: hidden;
756
+ clear: both;
757
+ }
758
+
759
+ :host span.align-right>span {
760
+ display: block;
761
+ margin: 13px 0 0;
762
+ overflow: hidden;
763
+ text-align: right;
764
+ }
765
+
766
+ :host span.align-right span img {
767
+ margin: 0;
768
+ text-align: right;
769
+ }
770
+
771
+ :host span.float-left {
772
+ display: block;
773
+ float: left;
774
+ margin-right: 13px;
775
+ overflow: hidden;
776
+ }
777
+
778
+ :host span.float-left span {
779
+ margin: 13px 0 0;
780
+ }
781
+
782
+ :host span.float-right {
783
+ display: block;
784
+ float: right;
785
+ margin-left: 13px;
786
+ overflow: hidden;
787
+ }
788
+
789
+ :host span.float-right>span {
790
+ display: block;
791
+ margin: 13px auto 0;
792
+ overflow: hidden;
793
+ text-align: right;
794
+ }
795
+
796
+ :host code,
797
+ :host tt {
798
+ padding: .2em .4em;
799
+ margin: 0;
800
+ font-size: 85%;
801
+ background-color: var(--color-neutral-muted);
802
+ border-radius: 6px;
803
+ }
804
+
805
+ :host code br,
806
+ :host tt br {
807
+ display: none;
808
+ }
809
+
810
+ :host del code {
811
+ text-decoration: inherit;
812
+ }
813
+
814
+ :host pre code {
815
+ font-size: 100%;
816
+ }
817
+
818
+ :host pre>code {
819
+ padding: 0;
820
+ margin: 0;
821
+ word-break: normal;
822
+ white-space: pre;
823
+ background: transparent;
824
+ border: 0;
825
+ }
826
+
827
+ :host .highlight {
828
+ margin-bottom: 16px;
829
+ }
830
+
831
+ :host .highlight pre {
832
+ margin-bottom: 0;
833
+ word-break: normal;
834
+ }
835
+
836
+ :host .highlight pre,
837
+ :host pre {
838
+ position: relative;
839
+ padding: 16px;
840
+ overflow: auto;
841
+ font-size: 85%;
842
+ line-height: 1.45;
843
+ background-color: var(--color-canvas-subtle);
844
+ border-radius: 6px;
845
+ }
846
+
847
+ :host pre code,
848
+ :host pre tt {
849
+ display: inline;
850
+ max-width: auto;
851
+ padding: 0;
852
+ margin: 0;
853
+ overflow: visible;
854
+ line-height: inherit;
855
+ word-wrap: normal;
856
+ background-color: transparent;
857
+ border: 0;
858
+ }
859
+
860
+ :host .csv-data td,
861
+ :host .csv-data th {
862
+ padding: 5px;
863
+ overflow: hidden;
864
+ font-size: 12px;
865
+ line-height: 1;
866
+ text-align: left;
867
+ white-space: nowrap;
868
+ }
869
+
870
+ :host .csv-data .blob-num {
871
+ padding: 10px 8px 9px;
872
+ text-align: right;
873
+ background: var(--color-canvas-default);
874
+ border: 0;
875
+ }
876
+
877
+ :host .csv-data tr {
878
+ border-top: 0;
879
+ }
880
+
881
+ :host .csv-data th {
882
+ font-weight: 600;
883
+ background: var(--color-canvas-subtle);
884
+ border-top: 0;
885
+ }
886
+
887
+ :host .footnotes {
888
+ font-size: 12px;
889
+ color: var(--color-fg-muted);
890
+ border-top: 1px solid var(--color-border-default);
891
+ }
892
+
893
+ :host .footnotes ol {
894
+ padding-left: 16px;
895
+ }
896
+
897
+ :host .footnotes li {
898
+ position: relative;
899
+ }
900
+
901
+ :host .footnotes li:target::before {
902
+ position: absolute;
903
+ top: -8px;
904
+ right: -8px;
905
+ bottom: -8px;
906
+ left: -24px;
907
+ pointer-events: none;
908
+ content: "";
909
+ border: 2px solid var(--color-accent-emphasis);
910
+ border-radius: 6px;
911
+ }
912
+
913
+ :host .footnotes li:target {
914
+ color: var(--color-fg-default);
915
+ }
916
+
917
+ :host .footnotes .data-footnote-backref g-emoji {
918
+ font-family: monospace;
919
+ }
920
+
921
+ :host .task-list-item {
922
+ list-style-type: none;
923
+ }
924
+
925
+ :host .task-list-item label {
926
+ font-weight: 400;
927
+ }
928
+
929
+ :host .task-list-item.enabled label {
930
+ cursor: pointer;
931
+ }
932
+
933
+ :host .task-list-item+.task-list-item {
934
+ margin-top: 3px;
935
+ }
936
+
937
+ :host .task-list-item .handle {
938
+ display: none;
939
+ }
940
+
941
+ :host .task-list-item-checkbox,
942
+ :host input[type="checkbox"] {
943
+ margin: 0 .2em .25em -1.6em;
944
+ vertical-align: middle;
945
+ }
946
+
947
+ :host .contains-task-list:dir(rtl) .task-list-item-checkbox,
948
+ :host .contains-task-list:dir(rtl) input[type="checkbox"] {
949
+ margin: 0 -1.6em .25em .2em;
950
+ }
951
+
952
+ :host ::-webkit-calendar-picker-indicator {
953
+ filter: invert(50%);
954
+ }
955
+ </style>
956
+ \`;
957
+ // See https://html.spec.whatwg.org/multipage/common-dom-interfaces.html
958
+ // #reflecting-content-attributes-in-idl-attributes.
959
+ const installStringReflection = (obj, attrName, propName = attrName) => {
960
+ Object.defineProperty(obj, propName, {
961
+ enumerable: true,
962
+ get() {
963
+ const value = this.getAttribute(attrName);
964
+ return value === null ? '' : value;
965
+ },
966
+ set(v) {
967
+ this.setAttribute(attrName, v);
968
+ },
969
+ });
970
+ };
971
+ export class MarkdownStyle extends HTMLElement {
972
+ constructor() {
973
+ super();
974
+ this.initTheme = this.getAttribute('theme');
975
+ installStringReflection(this, 'theme');
976
+ this.shadow = this.attachShadow({ mode: 'open' });
977
+ this.shadow.appendChild(__TEMPLATE__.content.cloneNode(true));
978
+ this.warpper = document.createElement('div');
979
+ this.warpper.classList.add('markdown-body');
980
+ this.shadow.appendChild(this.warpper);
981
+ Array.prototype.slice.call(this.shadow.host.childNodes).forEach((item) => this.warpper.appendChild(item));
982
+ this.setTheme();
983
+ }
984
+ setTheme() {
985
+ if (!this.initTheme) {
986
+ const { colorMode } = document.documentElement.dataset;
987
+ this.theme = colorMode;
988
+ if (this.theme === 'undefined') {
989
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
990
+ this.theme = 'dark';
991
+ }
992
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
993
+ this.theme = 'light';
994
+ }
995
+ }
996
+ }
997
+ this.warpper.setAttribute('data-color-mode', this.theme);
998
+ }
999
+ connectedCallback() {
1000
+ if (!this.initTheme) {
1001
+ this.setTheme();
1002
+ const observer = new MutationObserver((mutationsList, observer) => {
1003
+ this.theme = document.documentElement.dataset.colorMode;
1004
+ this.setTheme();
1005
+ });
1006
+ // Start observing the target node with the above configuration
1007
+ observer.observe(document.documentElement, { attributes: true });
1008
+ window.matchMedia('(prefers-color-scheme: light)').onchange = (event) => {
1009
+ this.theme = event.matches ? 'light' : 'dark';
1010
+ this.setTheme();
1011
+ };
1012
+ window.matchMedia('(prefers-color-scheme: dark)').onchange = (event) => {
1013
+ this.theme = event.matches ? 'dark' : 'light';
1014
+ this.setTheme();
1015
+ };
1016
+ }
1017
+ }
1018
+ }
1019
+ customElements.define('markdown-style', MarkdownStyle);
1020
+ //# sourceMappingURL=index.js.map
1021
+ `
1022
+
1023
+ export function markdownStyle(child: ElementContent[]): Element[] {
1024
+ return [{
1025
+ type: 'element',
1026
+ tagName: 'script',
1027
+ properties: {
1028
+ type: 'module',
1029
+ // src: 'https://unpkg.com/@wcj/markdown-style?module',
1030
+ },
1031
+ children: [{
1032
+ type: 'text',
1033
+ value: scriptString
1034
+ }]
1035
+ }, {
1036
+ type: 'element',
1037
+ tagName: 'div',
1038
+ properties: {
1039
+ style: 'max-width: 960px; margin: 28px auto 60px auto; padding: 8px'
1040
+ },
1041
+ children: [{
1042
+ type: 'element',
1043
+ tagName: 'markdown-style',
1044
+ children: child
1045
+ }]
1046
+ }]
1047
+ }