chiark / gitweb /
Migrate back to html2text.
authorSimon Tatham <anakin@pobox.com>
Fri, 29 Dec 2023 20:01:04 +0000 (20:01 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 30 Dec 2023 08:58:51 +0000 (08:58 +0000)
commit61fcc610a5e1522e743cf9f245a793e6720dc890
tree15476a83ffc5590d77ae485338883426dd277979
parenta77b334ea14a381a694a6df5b3fb111a7f5fa172
Migrate back to html2text.

I gave up on using it previously because it lacked some important
features - in particular, it didn't support CSS on <a> elements, which
is necessary for identifying hashtags and mentions in Mastodon's
output HTML.

In 0.9.2 that feature is present, so I can try again! Also, 0.9.2 has
the neat ability to save the RenderTree that's an intermediate product
of the pipeline, just before we depend on the width. So we can keep
that after parsing a toot, and then only re-run the necessary back end
of the pipeline to re-render at a different width.

The amount of code is extremely reduced.
Cargo.toml
src/html.rs
src/lib.rs
src/text.rs