From cd747ac41b937e5cafca5146cf1fb55514ec09f0 Mon Sep 17 00:00:00 2001 From: Wouter Coppieters Date: Sun, 18 Feb 2024 14:04:56 +1300 Subject: [PATCH] v0.1.10, support empty tableCells, and tableCells containing just hard breaks' --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 16 +-- docs/index.html | 2 +- src/adf_builder.rs | 2 +- src/adf_structure.rs | 2 +- src/extractor.rs | 22 ++++ src/tests/mod.rs | 1 + src/tests/tables.rs | 247 +++++++++++++++++++++++++++++++++++++++++ src/types/node_list.rs | 3 +- 10 files changed, 285 insertions(+), 14 deletions(-) create mode 100644 src/tests/tables.rs diff --git a/Cargo.lock b/Cargo.lock index 6414fbb..6783a5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "htmltoadf" -version = "0.1.9" +version = "0.1.10" dependencies = [ "clap", "ego-tree", diff --git a/Cargo.toml b/Cargo.toml index adae989..6a6d0ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "htmltoadf" -version = "0.1.9" +version = "0.1.10" edition = "2021" license = "MIT" description = "An HTML to Atlassian Document Format (ADF) converter" diff --git a/README.md b/README.md index 510b020..f432545 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ $ html2adf -h ``` ``` -htmltoadf 0.1.9 +htmltoadf 0.1.10 An HTML to Atlassian Document Format (ADF) converter USAGE: @@ -56,20 +56,20 @@ OPTIONS: ### Install Binary from Crates.io with `cargo install` ``` $ cargo install htmltoadf - installing htmltoadf v0.1.9 (/usr/src/html2adf) + installing htmltoadf v0.1.10 (/usr/src/html2adf) Updating crates.io index Downloading crates ... Downloaded lock_api v0.4.6 --snip-- - Compiling htmltoadf v0.1.9 + Compiling htmltoadf v0.1.10 Finished release [optimized] target(s) in 1m 42s Installing ~/.cargo/bin/htmltoadf - Installed package `htmltoadf v0.1.9` (executable `html2adf`) + Installed package `htmltoadf v0.1.10` (executable `html2adf`) ``` ### Download Binary file from Github Pre-built binaries can be downloaded from here: -https://github.com/wouterken/htmltoadf/releases/tag/0.1.9 +https://github.com/wouterken/htmltoadf/releases/tag/0.1.10 ### Docker Image **Docker Repo:** @@ -79,10 +79,10 @@ https://hub.docker.com/r/wouterken/html2adf **Usage** ```bash -$ echo "

Hello world

Test

" | docker run --rm -i wouterken/html2adf:0.1.9 +$ echo "

Hello world

Test

" | docker run --rm -i wouterken/html2adf:0.1.10 {"version":1,"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"type":"text","text":"Hello world"},{"type":"text","text":"Test"}]}]} -$ echo "

Hello world

Test

" | docker run --rm -i wouterken/html2adf:0.1.9 | jq +$ echo "

Hello world

Test

" | docker run --rm -i wouterken/html2adf:0.1.10 | jq { "version": 1, "type": "doc", @@ -115,7 +115,7 @@ $ echo "

Hello world

Test

" | docker run --rm -i wouterken/html2adf ```toml [dependencies] -htmltoadf = "0.1.9" +htmltoadf = "0.1.10" ``` **Code** diff --git a/docs/index.html b/docs/index.html index 9310411..a7d54f2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -79,7 +79,7 @@