-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ts
More file actions
938 lines (625 loc) · 25.2 KB
/
Copy pathexample.ts
File metadata and controls
938 lines (625 loc) · 25.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
import {getLocales} from 'expo-localization';
// Light and friendly sample markdown for Markdownr
const welcome_en = `---
title: Welcome to Markdownr
author: The Dude
date: 2025-01-15
tags:
- markdown
- mobile
- documentation
description: A pocket-friendly markdown viewer for iOS and Android
---
# Welcome to Markdownr
Your pocket-friendly markdown viewer for reading docs, notes, and READMEs on the go.
[☰ Table of Contents](markdownr:toc)
## Getting Started
Open any \`.md\` file from your device or cloud storage using the [menu button](markdownr:menu) below. Markdownr will render it beautifully!
### What You Can Do
- [Browse](markdownr:open) your markdown files
- [Search](markdownr:search) within documents
- [Switch](markdownr:theme)
- [Toggle](markdownr:darkmode)
---
## Front Matter Support
Markdownr automatically parses YAML front matter from your documents and displays it as a styled header with tags, title, author, and date.
[Toggle front matter visibility](markdownr:toggle-frontmatter) to show or hide the metadata block. You can also tap the info icon (ⓘ) in the top-right corner.
---
## Theme Support
Documents can suggest a theme via their front matter. Try it out:
[Open Ocean Theme Demo](markdownr:sample-ocean)
---
## Markdown Showcase
Here's a taste of what Markdownr can render:
### Text Formatting
You can write **bold text**, *italics*, or ***both together***. Need to show something removed? Use ~~strikethrough~~.
Inline \`code\` looks great for technical terms like \`useState\` or file names like \`package.json\`.
### Links & Images
Visit the [Markdownr repo](https://github.com) for updates!

### HTML Tags
#### Inline Formatting
Use <b>bold</b> or <strong>strong</strong> with HTML tags.
<i>Italic</i> and <em>emphasis</em> work too.
<s>Strikethrough</s>, <del>deleted</del>, and <strike>struck</strike> text.
<u>Underlined</u> and <ins>inserted</ins> text (rendered as underline).
<mark>Highlighted</mark> text stands out.
Chemical formulas: H<sub>2</sub>O, mathematical: x<sup>2</sup> + y<sup>2</sup>.
Inline HTML <code>code()</code> renders as code.
#### Line Breaks
Paragraph with a hard break<br>right here — using \`<br>\`.
Self-closing variant<br/>also works.
With a space<br />before the slash too.
\`<br>\` also works inside table cells:
| Name | Description |
|------|-------------|
| Alpha | First line<br>second line |
| Beta | One line only |
| Gamma | Line one<br>line two<br>line three |
#### Tags in Code (Preserved)
Inside a code span: \`<b>not bold</b>\` — tags are preserved literally.
\`\`\`html
<b>also preserved</b> in a code block
\`\`\`
### Lists
**Shopping list:**
- Milk
- Eggs
- Coffee beans
**Weekend plans:**
1. Morning run
2. Brunch with friends
3. Read a good book
**Project checklist:**
- [x] Design mockups
- [x] Set up project
- [ ] Write documentation
- [ ] Ship it!
### Blockquotes
> "The Dude abides."
> — Stranger
### Code Blocks
\`\`\`javascript
function greet(name) {
return \`Hello, \${name}!\`;
}
console.log(greet('Dude'));
\`\`\`
\`\`\`python
def fibonacci(n):
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
print(list(fibonacci(10)))
\`\`\`
### Tables
Wide tables scroll horizontally — try swiping left on this one:
| Feature | Notes |
|---------|-------|
| Dark Mode | Follows system setting or manual toggle |
| Search | Full-text search with match highlighting |
| Themes | Default, Sepia, Forest, Ocean, Dracula |
| File Types | Open from Files app or share sheet |
| Math (LaTeX) | Inline and block equations via KaTeX |
| Table of Contents | Auto-generated from headings |
| Pinch to Zoom | Zoom in on any content |
| Double-Tap Zoom | Quick 2x zoom toggle |
### Math Expressions
Einstein's famous equation: $E = mc^2$
The quadratic formula:
$$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$
### Nested Content
1. **First topic**
- Sub-point A
- Sub-point B
> A nested quote for emphasis
- Sub-point C
2. **Second topic**
- More details here
- And here too
---
## Tips & Tricks
> **Pro tip:** Swipe up on the menu to reveal more options like theme switching and dark mode toggle!
### Keyboard Shortcuts (on iPad)
| Shortcut | Action |
|----------|--------|
| Cmd + F | Search |
| Cmd + O | Open file |
`;
const welcome_de = `---
title: Willkommen bei Markdownr
author: The Dude
date: 2025-01-15
tags:
- markdown
- mobil
- dokumentation
description: Ein handlicher Markdown-Viewer für iOS und Android
---
# Willkommen bei Markdownr
Dein handlicher Markdown-Viewer zum Lesen von Dokumenten, Notizen und READMEs für unterwegs.
[☰ Inhaltsverzeichnis](markdownr:toc)
## Erste Schritte
Öffne eine beliebige \`.md\`-Datei von deinem Gerät oder Cloud-Speicher über die [Menü-Schaltfläche](markdownr:menu) unten. Markdownr stellt sie wunderschön dar!
### Was du tun kannst
- [Durchstöbere](markdownr:open) deine Markdown-Dateien
- [Suche](markdownr:search) in Dokumenten
- [Wechsle](markdownr:theme)
- [Umschalten](markdownr:darkmode)
---
## Front-Matter-Unterstützung
Markdownr parst automatisch YAML Front Matter aus deinen Dokumenten und zeigt es als gestalteten Header mit Tags, Titel, Autor und Datum an.
[Front Matter ein- oder ausblenden](markdownr:toggle-frontmatter), um den Metadaten-Block anzuzeigen oder zu verbergen. Du kannst auch auf das Info-Symbol (ⓘ) in der oberen rechten Ecke tippen.
---
## Theme-Unterstützung
Dokumente können über ihr Front Matter ein Theme vorschlagen. Probier es aus:
[Ocean-Theme-Demo öffnen](markdownr:sample-ocean)
---
## Markdown-Schaufenster
Hier ein Vorgeschmack darauf, was Markdownr darstellen kann:
### Textformatierung
Du kannst **fetten Text**, *Kursivschrift* oder ***beides zusammen*** schreiben. Musst du etwas Entferntes zeigen? Nutze ~~Durchgestrichenes~~.
Inline-\`Code\` sieht toll aus für technische Begriffe wie \`useState\` oder Dateinamen wie \`package.json\`.
### Links & Bilder
Besuche das [Markdownr-Repo](https://github.com) für Updates!

### HTML-Tags
#### Inline-Formatierung
Nutze <b>fett</b> oder <strong>stark</strong> mit HTML-Tags.
<i>Kursiv</i> und <em>Betonung</em> funktionieren auch.
<s>Durchgestrichen</s>, <del>gelöscht</del> und <strike>gestrichen</strike> Text.
<u>Unterstrichen</u> und <ins>eingefügt</ins> Text (als Unterstreichung dargestellt).
<mark>Hervorgehobener</mark> Text sticht heraus.
Chemische Formeln: H<sub>2</sub>O, mathematische: x<sup>2</sup> + y<sup>2</sup>.
Inline-HTML <code>code()</code> wird als Code dargestellt.
#### Zeilenumbrüche
Absatz mit einem harten Umbruch<br>genau hier — mit \`<br>\`.
Selbstschließende Variante<br/>funktioniert auch.
Mit einem Leerzeichen<br />vor dem Schrägstrich ebenfalls.
\`<br>\` funktioniert auch in Tabellenzellen:
| Name | Beschreibung |
|------|-------------|
| Alpha | Erste Zeile<br>zweite Zeile |
| Beta | Nur eine Zeile |
| Gamma | Zeile eins<br>Zeile zwei<br>Zeile drei |
#### Tags im Code (erhalten)
Innerhalb eines Code-Spans: \`<b>not bold</b>\` — Tags werden wörtlich erhalten.
\`\`\`html
<b>also preserved</b> in a code block
\`\`\`
### Listen
**Einkaufsliste:**
- Milch
- Eier
- Kaffeebohnen
**Wochenendpläne:**
1. Morgendlicher Lauf
2. Brunch mit Freunden
3. Ein gutes Buch lesen
**Projekt-Checkliste:**
- [x] Design-Mockups
- [x] Projekt aufsetzen
- [ ] Dokumentation schreiben
- [ ] Veröffentlichen!
### Blockzitate
> „The Dude bleibt gelassen."
> — Stranger
### Codeblöcke
\`\`\`javascript
function greet(name) {
return \`Hello, \${name}!\`;
}
console.log(greet('Dude'));
\`\`\`
\`\`\`python
def fibonacci(n):
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
print(list(fibonacci(10)))
\`\`\`
### Tabellen
Breite Tabellen scrollen horizontal — wisch bei dieser hier nach links:
| Funktion | Hinweise |
|---------|-------|
| Dark Mode | Folgt der Systemeinstellung oder manuellem Umschalten |
| Suche | Volltextsuche mit Treffer-Hervorhebung |
| Themes | Default, Sepia, Forest, Ocean, Dracula |
| Dateitypen | Aus der Dateien-App oder dem Teilen-Menü öffnen |
| Mathe (LaTeX) | Inline- und Block-Gleichungen via KaTeX |
| Inhaltsverzeichnis | Automatisch aus Überschriften generiert |
| Pinch to Zoom | In jeden Inhalt hineinzoomen |
| Doppeltipp-Zoom | Schneller 2x-Zoom-Umschalter |
### Mathematische Ausdrücke
Einsteins berühmte Gleichung: $E = mc^2$
Die quadratische Lösungsformel:
$$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$
### Verschachtelte Inhalte
1. **Erstes Thema**
- Unterpunkt A
- Unterpunkt B
> Ein verschachteltes Zitat zur Betonung
- Unterpunkt C
2. **Zweites Thema**
- Weitere Details hier
- Und auch hier
---
## Tipps & Tricks
> **Profi-Tipp:** Wisch im Menü nach oben, um weitere Optionen wie Theme-Wechsel und Dark-Mode-Umschalter zu enthüllen!
### Tastaturkürzel (auf dem iPad)
| Kürzel | Aktion |
|----------|--------|
| Cmd + F | Suchen |
| Cmd + O | Datei öffnen |
`;
const welcome_ru = `---
title: Добро пожаловать в Markdownr
author: The Dude
date: 2025-01-15
tags:
- markdown
- мобильный
- документация
description: Компактный просмотрщик Markdown для iOS и Android
---
# Добро пожаловать в Markdownr
Ваш компактный просмотрщик Markdown для чтения документов, заметок и файлов README на ходу.
[☰ Оглавление](markdownr:toc)
## Начало работы
Откройте любой файл \`.md\` с вашего устройства или облачного хранилища с помощью [кнопки меню](markdownr:menu) ниже. Markdownr отобразит его великолепно!
### Что вы можете делать
- [Просматривайте](markdownr:open) ваши файлы Markdown
- [Ищите](markdownr:search) внутри документов
- [Переключайте тему](markdownr:theme)
- [Переключайте режим](markdownr:darkmode)
---
## Поддержка Front Matter
Markdownr автоматически разбирает YAML Front Matter из ваших документов и отображает его как оформленный заголовок с тегами, названием, автором и датой.
[Показать или скрыть Front Matter](markdownr:toggle-frontmatter), чтобы отобразить или скрыть блок метаданных. Вы также можете нажать на значок информации (ⓘ) в правом верхнем углу.
---
## Поддержка тем
Документы могут предлагать тему через свой Front Matter. Попробуйте:
[Открыть демо темы Ocean](markdownr:sample-ocean)
---
## Витрина Markdown
Вот образец того, что может отобразить Markdownr:
### Форматирование текста
Вы можете писать **жирный текст**, *курсив* или ***и то и другое вместе***. Нужно показать что-то удалённое? Используйте ~~зачёркивание~~.
Строчный \`код\` отлично смотрится для технических терминов вроде \`useState\` или имён файлов вроде \`package.json\`.
### Ссылки и изображения
Посетите [репозиторий Markdownr](https://github.com) для обновлений!

### HTML-теги
#### Строчное форматирование
Используйте <b>жирный</b> или <strong>сильный</strong> с HTML-тегами.
<i>Курсив</i> и <em>выделение</em> тоже работают.
<s>Зачёркнутый</s>, <del>удалённый</del> и <strike>перечёркнутый</strike> текст.
<u>Подчёркнутый</u> и <ins>вставленный</ins> текст (отображается как подчёркивание).
<mark>Выделенный</mark> текст бросается в глаза.
Химические формулы: H<sub>2</sub>O, математические: x<sup>2</sup> + y<sup>2</sup>.
Строчный HTML <code>code()</code> отображается как код.
#### Переносы строк
Абзац с жёстким переносом<br>прямо здесь — с помощью \`<br>\`.
Самозакрывающийся вариант<br/>тоже работает.
С пробелом<br />перед слэшем тоже.
\`<br>\` также работает внутри ячеек таблицы:
| Имя | Описание |
|------|-------------|
| Alpha | Первая строка<br>вторая строка |
| Beta | Только одна строка |
| Gamma | Строка один<br>строка два<br>строка три |
#### Теги в коде (сохраняются)
Внутри строчного кода: \`<b>not bold</b>\` — теги сохраняются буквально.
\`\`\`html
<b>also preserved</b> in a code block
\`\`\`
### Списки
**Список покупок:**
- Молоко
- Яйца
- Кофейные зёрна
**Планы на выходные:**
1. Утренняя пробежка
2. Бранч с друзьями
3. Прочитать хорошую книгу
**Контрольный список проекта:**
- [x] Дизайн-макеты
- [x] Настроить проект
- [ ] Написать документацию
- [ ] Выпустить!
### Цитаты
> «The Dude сохраняет спокойствие.»
> — Stranger
### Блоки кода
\`\`\`javascript
function greet(name) {
return \`Hello, \${name}!\`;
}
console.log(greet('Dude'));
\`\`\`
\`\`\`python
def fibonacci(n):
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
print(list(fibonacci(10)))
\`\`\`
### Таблицы
Широкие таблицы прокручиваются горизонтально — попробуйте смахнуть влево на этой:
| Функция | Заметки |
|---------|-------|
| Тёмный режим | Следует системной настройке или ручному переключению |
| Поиск | Полнотекстовый поиск с подсветкой совпадений |
| Темы | Default, Sepia, Forest, Ocean, Dracula |
| Типы файлов | Открытие из приложения Файлы или меню «Поделиться» |
| Математика (LaTeX) | Строчные и блочные уравнения через KaTeX |
| Оглавление | Автоматически генерируется из заголовков |
| Щипок для масштаба | Приближение любого содержимого |
| Масштаб двойным касанием | Быстрое переключение масштаба 2x |
### Математические выражения
Знаменитое уравнение Эйнштейна: $E = mc^2$
Формула корней квадратного уравнения:
$$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$
### Вложенное содержимое
1. **Первая тема**
- Подпункт A
- Подпункт B
> Вложенная цитата для акцента
- Подпункт C
2. **Вторая тема**
- Больше деталей здесь
- И здесь тоже
---
## Советы и хитрости
> **Совет профи:** Смахните вверх по меню, чтобы открыть больше опций, таких как переключение тем и переключатель тёмного режима!
### Сочетания клавиш (на iPad)
| Сочетание | Действие |
|----------|--------|
| Cmd + F | Поиск |
| Cmd + O | Открыть файл |
`;
const welcomeTranslations: Record<string, string> = {
en: welcome_en,
de: welcome_de,
ru: welcome_ru,
};
export function getWelcomeMarkdown(): string {
const languageCode = getLocales()[0]?.languageCode ?? 'en';
return welcomeTranslations[languageCode] ?? welcome_en;
}
// Backwards-compat: static English default
export const EXAMPLE_MARKDOWN = welcome_en;
// Keep the old comprehensive example for reference/testing
export const COMPREHENSIVE_EXAMPLE = `# Nitro Markdown
Welcome to the **high-performance** markdown parser powered by \`md4c\` and **Nitro Modules**.
## Features Showcase
This parser supports *all* the features you'd expect:
- **Bold text** with double asterisks
- *Italic text* with single asterisks
- ~~Strikethrough text~~ (GFM)
- \`Inline code\` snippets
- [Links](https://github.com)
- 
**Bold text** and *italic text* and ***bold italic text***.
__Alternative bold__ and _alternative italic_ and ___alternative bold italic___.
~~Strikethrough text~~ and ~~**strikethrough bold**~~ and ~~*strikethrough italic*~~.
Regular text with **bold in the middle** and more text.
A sentence with *multiple* **formatting** ***options*** mixed ~~together~~.
## Some Lists / Tasks
**Quick actions:**
- [ ] Reply to Sarah's email about the \`Series A\` discussion
- [ ] Update your notes on the *TechCrunch* meeting
- [x] Review the [shared document](https://docs.example.com/pitch) before Thursday
**List:**
- Reply to Sarah's email about the \`Series A\` discussion
- Update your notes on the *TechCrunch* meeting
- Review the [shared document](https://docs.example.com/pitch) before Thursday
#### Images


## Advanced GFM Features
### Task Lists
- [x] Implement md4c parser
- [x] Create Nitro bindings
- [x] Build AST converter
- [ ] Add syntax highlighting
- [ ] Implement caching
### Tables with Complex Content
| Feature | Description | Status | Performance |
|:--------|:------------|:-------|:------------|
| JSI Binding | Direct JS <-> C++ communication | Done | Microseconds |
| Native Threading | Background processing | Done | Optimized |
| Zero-Copy | No data duplication | Done | Memory efficient |
| Math Support | LaTeX expressions | Done | Full featured |
| GFM Tables | Advanced table rendering | Done | Complete spec |
| Name | Email |
|------|-------|
| Alice | alice@example.com |
| Bob | bob@example.com |
## LaTeX Mathematics
### Inline Math
- Simple: $E = mc^2$ with more text after It. Simple: $E = mc^2$ with more text after It.
- Complex: $\\frac{d}{dx}[x^n] = nx^{n-1}$
- Greek letters: $\\alpha + \\beta = \\gamma$
- Subscripts: $x_1, x_2, \\dots, x_n$
- Superscripts: $x^2, y^{n+1}, e^{\\pi i}$
### Block Math (Display Mode)
The quadratic formula:
$$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$
Pythagorean theorem:
$$a^2 + b^2 = c^2$$
Matrix operations:
$$\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix} \\times \\begin{pmatrix} x \\\\ y \\end{pmatrix} = \\begin{pmatrix} ax + by \\\\ cx + dy \\end{pmatrix}$$
## Code Blocks with Syntax Highlighting
### TypeScript
\`\`\`typescript
import { parseMarkdown, parseMarkdownWithOptions } from 'react-native-nitro-markdown';
interface ParserOptions {
gfm?: boolean;
math?: boolean;
}
const parseWithGFM = (text: string): MarkdownNode => {
return parseMarkdownWithOptions(text, {
gfm: true,
math: true
});
};
\`\`\`
### C++ (Native Implementation)
\`\`\`cpp
#include "MD4CParser.hpp"
std::shared_ptr<MarkdownNode> parseMarkdown(
const std::string& text,
const ParserOptions& options
) {
MD4CParser parser;
return parser.parse(text, options);
}
\`\`\`
### Complex Nested Structures
#### Deeply Nested Lists
1. First level ordered item
- Second level unordered
- Another second level
1. Third level ordered
2. Another third level
- Fourth level unordered
- More fourth level items
- Back to second level
2. Second first level item
1. Nested ordered in second item
2. Another nested ordered
#### Blockquotes Within Lists
1. First item with blockquote:
> This is a blockquote inside a list item
>
> It can span multiple lines
> And contain **formatting**
2. Second item
- Nested bullet with blockquote:
> Another blockquote
> With multiple paragraphs
>
> And even more content
### Multi-line Blockquote
> This blockquote spans multiple lines.
> It continues here on the second line.
> And even a third line for good measure.
### Blockquote with Formatting
> **Important:** This blockquote contains *formatted* text.
> It also has \`inline code\` and a [link](https://example.com).
### Text After Blockquote
> A quote about something meaningful.
Regular paragraph text that follows the blockquote.
## Horizontal Rules and Separators
Content above first rule
---
Content between rules
***
More content between rules
___
Content below rules
## Unicode and International Content
### Multiple Languages
- English: Hello world!
- Espanol: Hola mundo!
- Francais: Bonjour le monde!
- Deutsch: Hallo Welt!
- Chinese: Ni hao!
- Japanese: Konnichiwa!
- Arabic: Marhaba!
### Special Characters and Symbols
- Mathematical: + - x / = < >
- Arrows: <- ->
- Currency: $ EUR JPY GBP
- Legal: (c) (R) TM
- Fractions: 1/2 1/3 1/4 3/4
## Performance Test Patterns
### Repeated Patterns
**Bold text** repeated for *performance testing* with \`code blocks\` and [links](url) to ensure the parser handles repetition efficiently without memory leaks or performance degradation.
### Large Content Sections
This section contains intentionally large blocks of content to test how well the parser scales with document size. The content includes various markdown elements mixed together in realistic patterns that would appear in actual documentation or blog posts.
By including diverse content types - headings, paragraphs, lists, tables, code blocks, math expressions, and international text - we create a comprehensive test that exercises all aspects of the markdown parsing engine.
The goal is to ensure that performance remains consistent regardless of content complexity or document length, providing users with reliable and fast markdown processing capabilities.
### Stress Testing Elements
- Multiple consecutive code blocks
- Tables with many columns and rows
- Deeply nested list structures
- Complex mathematical expressions
- Mixed inline formatting combinations
- Large blocks of plain text
- Unicode characters from multiple languages
- Special symbols and emoji combinations
This comprehensive test suite validates that the parser maintains high performance and accuracy across all supported markdown features and edge cases.
## HTML Tags
### Inline Formatting
Use <b>bold</b> or <strong>strong</strong> with HTML tags.
<i>Italic</i> and <em>emphasis</em> work too.
<s>Strikethrough</s>, <del>deleted</del>, and <strike>struck</strike> text.
<u>Underlined</u> and <ins>inserted</ins> text.
<mark>Highlighted</mark> text.
H<sub>2</sub>O and x<sup>2</sup>.
Inline HTML <code>code()</code>.
### Line Breaks
Paragraph with a hard break<br>right here — using \`<br>\`.
Self-closing variant<br/>also works.
With a space<br />before the slash too.`;
export const OCEAN_THEMED_SAMPLE = `---
title: Ocean Theme Demo
author: Markdownr
theme: ocean
tags:
- themes
- demo
---
# Exploring Ocean Theme
This document includes \`theme: ocean\` in its front matter. You should see a banner at the top suggesting the Ocean theme.
Tap **Apply** to switch, or **Dismiss** to keep your current theme.
---
## How It Works
Any markdown file can include a \`theme\` key in its YAML front matter:
\`\`\`yaml
---
theme: ocean
---
\`\`\`
### Built-in Themes
You can use any built-in theme name:
| Theme | Emoji | Style |
|-------|-------|-------|
| default | ⚪ | Clean and minimal |
| ocean | 🌊 | Cool blues and teals |
| forest | 🌲 | Earthy greens |
| sunset | 🌅 | Warm oranges and reds |
| lavender | 💜 | Soft purples |
### Remote Themes
You can also point to a remote JSON theme:
\`\`\`yaml
---
theme: https://example.com/my-theme.json
---
\`\`\`
Remote themes are fetched, validated, and cached for offline use. They can even include custom fonts!
---
> "The sea, once it casts its spell, holds one in its net of wonder forever."
> — Jacques Cousteau
---
[Back to Welcome](markdownr:home)
`;
export const CUSTOM_RENDER_COMPONENTS = `# Custom Renderer Examples
> **Tip:** Use the bottom tabs to switch between rendering modes!
>
> - **Default:** Standard markdown rendering
> - **Styles:** Custom accents and retro typography
> - **Custom:** Completely replaced components (Cards, Alerts, etc.)
## Custom Components Demo
This image will look like a standard image in **Default**, but like a "Card" with shadow in **Custom**:

This blockquote will look like a gray bar in **Default**, but like an "Alert Info" box in **Custom**:
> **Did you know?**
>
> The Custom renderer replaces the standard \`View\` with a specialized component that includes an icon and different layout logic!
---`;