hypothesis / hypothesis/h

annotate text in SVG documents

Open
#9,990 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
3.2k
Forks
459
Avg merge
27d 1h
Merged PRs (30d)
1

Description

annotating text in SVG documents
is currently not possible with the hypothesis browser extension

challenge: visualize annotated text parts in SVG
to make this consistent with annotations in HTML
we would have to add a `hypothesis-highlight` rectangle
behind the SVG text element

challenge: handle annotations
not aligning with SVG text element boundaries

challenge: handle darkmode
([prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme), [darkreader](https://darkreader.org/), ...)

use case:
[hocr2epubfxl](https://github.com/internetarchive/archive-hocr-tools/pull/23) - EPUB-FXL ebooks based on SVG
example book: the preparation: [hocr](https://github.com/milahu/the-preparation-by-doug-casey-2025) → [epub](https://github.com/milahu/the-preparation-by-doug-casey-2025-epub)

[test.svg](https://milahu.github.io/hypothesis-annotations-svg-text/test.svg)
[solutions.svg](https://milahu.github.io/hypothesis-annotations-svg-text/solutions.svg)
[source](https://github.com/milahu/hypothesis-annotations-svg-text)

test.svg

```svg

```

solutions.svg

```svg

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.