Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

fwonkas/highlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

highlight.js

Allows for highlighting paragraphs and sentences by modifying URL's hash. In browsers that support the "onhashchange" event, a reload of the page is not required.

Example hashes:

  • #h4 — highlights paragraph 4.
  • #h5s3 — highlights sentence 3 in paragraph 5.
  • #h2s1-4 — highlights sentences 1–4 in paragraph 2.
  • #p6 — scroll to paragraph 6.

Notes:

  • Sentence detection is hard. This javascript tries to avoid some obvious pitfalls and I hope to improve it, but it's far, far from perfect. It's not even very good, though it's better than it was.
  • The <mark> tag is used to mark sentences. If <mark> tags are already present in the text blocks, some sentence highlighting may not work right.

See highlight.html for further examples.

About

Highlight paragraphs and sentences

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published