* Optimize PipeTable parsing: O(n²) → O(n) for large tables
Pipe tables were creating deeply nested tree structures where each pipe
delimiter contained all subsequent content as children, causing O(n²)
traversal complexity for n cells. This change restructures the parser to
use a flat sibling-based structure, treating tables as matrices rather
than nested trees.
Key changes:
- Set IsClosed=true on PipeTableDelimiterInline to prevent nesting
- Add PromoteNestedPipesToRootLevel() to flatten pipes nested in emphasis
- Update cell boundary detection to use sibling traversal
- Move EmphasisInlineParser before PipeTableParser in processing order
- Fix EmphasisInlineParser to continue past IsClosed delimiters
- Add ContainsParentOrSiblingOfType<T>() helper for flat structure detection
Performance improvements (measured on typical markdown content):
| Rows | Before | After | Speedup |
|------|-----------|---------|---------|
| 100 | 542 μs | 150 μs | 3.6x |
| 500 | 23,018 μs | 763 μs | 30x |
| 1000 | 89,418 μs | 1,596 μs| 56x |
| 1500 | 201,593 μs| 2,740 μs| 74x |
| 5000 | CRASH | 10,588 μs| ∞ |
| 10000| CRASH | 18,551 μs| ∞ |
Tables with 5000+ rows previously crashed due to stack overflow from
recursive depth. They now parse successfully with linear time complexity.
* remove baseline results file
* Do not use System.Index and fix nullabillity checks for older platforms
* Recognize supplementary characters
* Internatize Rune
* Fix failing tests
* Fix extra comment error
* Remove extra local variable c
* Reorganize classes around Rune
* Prepare both Rune and char variants / make Rune variant public for .NET
* Make APIs in StringSlice.cs public only in modern .NET
* Throw exception if cannot obtain first Rune
* Add comments
* Add comment on PeekRuneExtra
* Use `Rune.TryCreate`
* Remove backtrack
* Fix parameter name in XML comment
* Don't throw when error in `Rune.DecodeFromUtf16`
* Fix RuneAt
* Add tests of Rune-related methods of `StringSlice`
* Make comment more tolerant of changes
* Tweak comment
* Fix comment
* Add `readonly`
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Move namespace of polyfilled Rune out of System.Text
* Apply suggestions from code review
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Fix regression by review suggestion
* Prepare constant for .NET Standard test
* Don't call `IsPunctuationException` if unnecessary
* PR feedback
---------
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* feat(link-helper): improve ASCII normalization handling
Enhanced the `Urilize` method to better handle ASCII normalization and special characters. Added support for decomposing characters when `allowOnlyAscii` is true and skipping diacritical marks. Introduced handling for special German, Scandinavian, and Icelandic characters via new helper methods: `IsSpecialScandinavianOrGermanChar` and `NormalizeScandinavianOrGermanChar`.
Reorganized `using` directives for better clarity. Updated the processing loop in `Urilize` to handle normalized spans and ASCII equivalents more effectively. These changes improve link generation compatibility across various languages.
* Add tests for Scandinavian and German character normalization
Added tests for NormalizeScandinavianOrGermanChar method to validate character normalization for various special characters in both ASCII and non-ASCII contexts.
* test(link-helper): update ASCII transliteration tests
Updated test cases in `TestUrilizeOnlyAscii_Simple` to reflect
changes in `LinkHelper.Urilize` behavior. Non-ASCII characters
like `æ` and `ø` are now transliterated to their ASCII
equivalents (`ae` and `oe`) instead of being removed.