mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
[PR #305] [MERGED] Emoji and abbreviations parser #933
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/305
Author: @MihaZupan
Created: 2/6/2019
Status: ✅ Merged
Merged: 2/8/2019
Merged by: @xoofx
Base:
master← Head:emoji-and-abbreviations-parser📝 Commits (8)
b15b050Allow single-char abbreviationsca38da5Cross target NetCore 2.1d854b0bPort CompactPrefixTree to Markdig325495aImprove EmojiParser memory performanceef452c2Fix Abbreviations parser's one-char handling18e9486Remove TextMatchHelpera11676eAdd test case for Extension - Header sections (#296)b5293b9Comment-out TextMatcher test in Benchmarks📊 Changes
9 files changed (+1383 additions, -257 deletions)
View changed files
📝
src/Markdig.Benchmarks/TestMatchPerf.cs(+3 -2)📝
src/Markdig.Tests/Specs/AbbreviationSpecs.cs(+40 -1)📝
src/Markdig.Tests/Specs/AbbreviationSpecs.md(+21 -0)📝
src/Markdig/Extensions/Abbreviations/AbbreviationParser.cs(+38 -54)📝
src/Markdig/Extensions/Emoji/EmojiParser.cs(+75 -72)➕
src/Markdig/Helpers/CompactPrefixTree.cs(+1110 -0)➖
src/Markdig/Helpers/TextMatcher.cs(+0 -127)➕
src/Markdig/Helpers/ThrowHelper.cs(+90 -0)📝
src/Markdig/Markdig.csproj(+6 -1)📄 Description
Fixes #296
Fewer memory allocations:
Building a new pipeline:
Where
Modifiedforces the lazy-init of dictionary properties.Parsing speed for emojis and abbreviations is about the same (~10% faster for emojis),
as the dataset could be considered the worst-case for a prefix tree of this type (every input starts with the same character).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.