Skip to content

Releases: alienzhou/web-highlighter

v0.7.4

24 Jun 04:53
Compare
Choose a tag to compare

Fix

Removing unsupported APIs to fix compatibility issues in IE11:

v0.7.3

19 Jun 07:00
Compare
Choose a tag to compare

Fix

  • highlight wrapper inside another wrapper not get updated when deleting #80
  • make the className the latest one when wrapping a partial or an overlap node #82

Improvement

  • better typings for event emitter #81
  • tsconfig path alias and npm scripts #84

v0.7.2

19 Jun 06:41
Compare
Choose a tag to compare

Fix

  • including type declarations in the package.json
  • making public .options a private field

v0.7.1

16 Jan 16:22
576508a
Compare
Choose a tag to compare

Features

  • Generating .d.ts files for projects using typescript.

Fix

  • Select the range's container element correctly when it is not Text/Comment/CDATASection. #56

v0.7.0

12 Jul 06:13
Compare
Choose a tag to compare

Features

  • Make get id methods more flexible.
    • It will get correct id(s) inside a wrapper. No need to be a wrapper element.
    • It is limited in the root scope.

Fix

  • Retain the wrapper's classname when wrapping a partial node.

v0.6.0

20 May 17:31
Compare
Choose a tag to compare

Features

  • Add .getExtraIdByDom instance method which helps get extra ids from a wrapper. more>>
  • Add a new hook: Serialize.Restore. You can use it to customize your own restoring method. When you tap this hook, the HighlightSource instance will use the function you pass to calculate the start and end nodes' info. more>>
  • Support remove function in hooks. Now hook.tap() will return a function for removing it. Besides, you can also call hook.remove() to remove a tapped function.

Fix

  • When pre&next nodes are empty texts, the text node's wrapper should not be split.
  • Avoid add duplicate functions to a hook.

Other updates

  • Add unit tests for hook, event emitter and new features.
  • Use unknown type instead of any.

v0.5.2

17 May 16:10
6a006fb
Compare
Choose a tag to compare

Features

  • Support verbose configuration. It decides whether warning&error message will be output.
  • Add a static method .isHighlightWrapNode(). You can use it to test whether a node(DOM) is a highlight wrapper.

Fix

  • Prevent emit REMOVE event when no node is affected by calling .remove() and .removeAll()
  • Fix the bug in .getAll, now it will return correct data
  • Prevent injecting duplicate stylesheets when one has been injected

Other updates

  • Add a suit of unit tests to ensure the code quality.
  • Refactor the way of error reporting.
  • Remove .dataset polyfill.

v0.5.1

17 May 14:58
d910c4c
Compare
Choose a tag to compare

Fix

  • fix the bug: When the root node has no children (except text nodes), the highlights can't be recreate by sources. #38

v0.6.0-beta.0

17 May 14:49
Compare
Choose a tag to compare

Features

  • add a new hook: Serialize.Restore

Customize your own restoring method. When you tap this hook, the HighlightSource instance will use the function you pass to calculate the start and end nodes' info.

see more >>

v0.5.0

22 Jan 07:26
f71330a
Compare
Choose a tag to compare

Features

  • add an option: support changing the default wrapper's tag name

using it as below

const highlighter = new Highlighter({
    wrapTag: 'b'
});