│ │
│ │ │ │
│ │ │ │ │
│ └─┼─────┼─┐ │ │
└──────────┼┴─┼───┼─┼──┼────┬───┴─
│ │ └┬───┴────┼┐
┌───────┬─┴─┴┴────┼────┐ ││
│ │ │
│
This is tiny, zero-dependency library for merging special characters, based on the official UTF8 tables. This library is mainly useful for overlapping some text on other text, while preserving as much visual information as possible.
const mergeChar = // results in ┴ // not mergable: will return null
Limitations
Currently the only characters that are supported are a subset of the UTF8 box drawing characters. Feel free to open a pull request if you'd like to see some other characters supported.
API
isMergable(char)
Checks if given character is mergable with other characters, based on the merging tables.
mergeChars(...chars)
Merges the given characters, returning the merged character is one is found. In
case of failure, null
is returned.