[package]
name = "damascene-markdown"
version = "0.4.3"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Damascene — markdown to El tree transformer"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["ui", "gui", "markdown", "renderer"]
categories = ["gui", "text-processing"]

[lib]
path = "src/lib.rs"

[features]
# `highlighting` pulls in `syntect` (regex-fancy backend, no `onig` C
# dependency) and `two-face` for an extra grammar set on top of
# syntect's defaults. Default-on so `damascene_markdown::md(...)` ships
# highlighted fenced code out of the box; `default-features = false`
# opts out of the highlighter entirely (and saves ~1 MB of bundled
# syntax dumps + ~5 deps in the build graph).
default = ["highlighting"]
highlighting = ["dep:syntect", "dep:two-face"]
# `html` opts the inline-HTML and block-HTML pulldown-cmark events
# into the `damascene-html` transformer instead of being dropped.
# Default-off so existing consumers see no behaviour change and the
# `html5ever` dep stays out of the build graph for everyone who
# only wants pure markdown.
html = ["dep:damascene-html"]

[dependencies]
damascene-core = { version = "0.4.3", path = "../damascene-core", default-features = false }
damascene-html = { version = "0.4.3", path = "../damascene-html", optional = true }
pulldown-cmark = { version = "0.13.3", default-features = false }
# Pure-Rust regex backend; pulled in only with the `highlighting`
# feature. We use the parsing path (ParseState + ScopeStack) and skip
# syntect's themes so we can map scopes to Damascene palette tokens
# directly — palette swaps recolour the syntax run automatically.
syntect = { version = "5.3", optional = true, default-features = false, features = ["parsing", "default-syntaxes", "regex-fancy", "dump-load"] }
# Extra grammars that the syntect default set lacks (Rust beyond
# Sublime defaults, TOML, GraphQL, Dockerfile, etc.). We pull in only
# the syntect-fancy feature so the regex backend matches the syntect
# above; we don't use two-face's themes.
two-face = { version = "0.5", optional = true, default-features = false, features = ["syntect-fancy"] }

[dev-dependencies]
# Tests shape real text (list-marker measurement, selection fixtures),
# so re-enable the default font set for test builds; the normal-dep
# edge stays `default-features = false` (issue #49). Same pattern as
# damascene-html — without this, isolated `cargo test -p
# damascene-markdown` runs die with cosmic-text's "no default font".
damascene-core = { version = "0.4.3", path = "../damascene-core" }
