Closed dannyChyang closed 4 years ago
0.3.3
highlighter.removeAll()API不起作用。追踪了代码,发现util/dom.ts 42 行getHighlightsByRoot()函数中没有返回concat后的新值。
highlighter.removeAll()
util/dom.ts
getHighlightsByRoot()
export const getHighlightsByRoot = ($roots: HTMLElement | Array<HTMLElement>): Array<HTMLElement> => { if (!Array.isArray($roots)) { $roots = [$roots]; } const $wraps = []; for (let i = 0; i < $roots.length; i++) { const $list = $roots[i].querySelectorAll(`${WRAP_TAG}[data-${DATASET_IDENTIFIER}]`); // $wraps.concat($list); $wraps.push.apply($wraps, $list); } return $wraps; }
Merged. Thanks!
Version
0.3.3
Problem
highlighter.removeAll()
API不起作用。追踪了代码,发现util/dom.ts
42 行getHighlightsByRoot()
函数中没有返回concat后的新值。