Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions lib/Demojify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,34 @@ local blockedRanges = {
{ 0x0001F9BA, 0x0001F9BF },
{ 0x0001F9C3, 0x0001F9CA },
{ 0x0001FA70, 0x0001FA73 },
-- unicode 13
{ 0x0001F6D6, 0x0001F6D7 },
{ 0x0001F6FB, 0x0001F6FC },
{ 0x0001F977, 0x0001F978 },
{ 0x0001F9A3, 0x0001F9A4 },
{ 0x0001F9AB, 0x0001F9AD },
{ 0x0001FA83, 0x0001FA86 },
{ 0x0001FA96, 0x0001FAA8 },
{ 0x0001FAB0, 0x0001FAB6 },
{ 0x0001FAC0, 0x0001FAC2 },
{ 0x0001FAD0, 0x0001FAD6 },
-- unicode 14
{ 0x0001F6DD, 0x0001F6DF },
{ 0x0001FA7B, 0x0001FA7C },
{ 0x0001FAA9, 0x0001FAAC },
{ 0x0001FAB7, 0x0001FABA },
{ 0x0001FAC3, 0x0001FAC5 },
{ 0x0001FAD7, 0x0001FAD9 },
{ 0x0001FAE0, 0x0001FAE7 },
{ 0x0001FAF0, 0x0001FAF6 },
-- unicode 15
{ 0x0001FA75, 0x0001FA77 },
{ 0x0001FA87, 0x0001FA88 },
{ 0x0001FAAD, 0x0001FAAF },
{ 0x0001FABB, 0x0001FABD },
{ 0x0001FACE, 0x0001FACF },
{ 0x0001FADA, 0x0001FADB },
{ 0x0001FAF7, 0x0001FAF8 },
}

-- Miscellaneous UTF8 codepoints that should be blocked
Expand Down Expand Up @@ -228,6 +256,25 @@ local blockedSingles = lookupify({
0x0001FA78,
0x0001FA79,
0x0001FA7A,
-- unicode 13
0x0001F90C,
0x0001F972,
0x0001F9CB,
0x0001FA74,
0x0000FE0F,
0x0001F3FB,
0x0001F3FC,
0x0001F3FD,
0x0001F3FE,
0x0001F3FF,
-- unicode 14
0x0001F7F0,
0x0001F979,
0x0001F9CC,
-- unicode 15
0x0001F6DC,
0x0001FABF,
0x0001FAE8,
})

-- Demojify function
Expand Down
16 changes: 16 additions & 0 deletions test/demojify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,20 @@ Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:
""" == doc

doc = test_pandoc("test🫠🫢🫣🫡🫥🫤🥹🫱🫲🫳🫴🫰🫵🫶🫦🫅🫃🫄🧌🪸🪷🪹🪺🫘🫗🫙🛝🛞🛟🪬🪩🪫🩼🩻🫧🪪🟰"; demojify = true)

@test """
*test.txt* Test Description

==============================================================================
Table of Contents *test-table-of-contents*

test

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:
""" == doc

end