Open snowyu opened 5 years ago
Workaround:
import {default as LineBreaker} from "@craigmorton/linebreak";
import { textWrap } from 'd3plus-text';
const wrapper = textWrap
.split(splitStr)
.width(...);
function splitStr(sentence) {
const breaker = new LineBreaker(sentence);
const result = [];
let bk;
let lastPos = 0;
// eslint-disable-next-line no-cond-assign
while (bk = breaker.nextBreak()) {
const word = sentence.slice(lastPos, bk.position);
lastPos = bk.position;
result.push(word);
}
return result;
}
Expected Behavior
The default textSplit function should display all emoji unicode characters: "🐉️🧚🏻♀️🧚🏻♂️". and the Chinsese quotation marks
“”
.Current Behavior
All emoji and Chinese quotation marks unicode chars are filtered out.
Maybe It is related to #94 too.
Please use the Unicode Line Breaking Algorithm