defmodule ExditorJS do @moduledoc """ Native Elixir module for converting Markdown and HTML to EditorJS format using Rustler for performance. This module provides functions to convert HTML and Markdown content into EditorJS block format, which can be used with the Editor.js library. """ version = Mix.Project.config()[:version] use RustlerPrecompiled, otp_app: :exditorjs, crate: "exditorjs_native", base_url: "https://github.com/OutdoorMap/exditorjs/releases/download/v#{version}", force_build: System.get_env("RUSTLER_EXDITORJS_FORCE_BUILD") in ["1", "true"], targets: Enum.uniq(["aarch64-unknown-linux-musl" | RustlerPrecompiled.Config.default_targets()]), version: version @doc """ Converts HTML to EditorJS blocks format. Takes a string containing HTML and returns a list of EditorJS blocks that can be used with Editor.js. ## Examples iex> ExditorJS.html_to_editorjs("
World
") {:ok, [%{"type" => "heading", ...}, %{"type" => "paragraph", ...}]} iex> ExditorJS.html_to_editorjs("