//! Helpers for quick-xml 0.38+ entity-reference events.
//!
//! Since quick-xml 0.38, entity references (`&`, `&`, …) no longer
//! arrive inside `Event::Text` — they stream as separate `Event::GeneralRef`
//! events. Reader loops must resolve these and stitch them back into the
//! surrounding text, otherwise any value containing an entity is silently
//! truncated.
use BytesRef;
/// Resolve a general entity reference to its decoded text value.
///
/// Handles numeric character references (`&`, `&`) and the five
/// predefined XML entities (`amp`, `lt`, `gt`, `apos`, `quot`). Returns
/// `None` for unknown user-defined entities, which callers should skip
/// (matching the old `unescape()` error behavior of not inventing content).
pub
/// Reconstruct the raw wire form (`&name;`) of an entity reference.
///
/// Used when rebuilding inner XML verbatim: the reference is kept escaped so
/// the reconstructed fragment stays well-formed and round-trips exactly,
/// including user-defined entities we cannot resolve.
pub