Skip to main content

detect_document_format

Function detect_document_format 

Source
pub fn detect_document_format(source: &[u8], limits: Limits) -> DocumentFormat
Expand description

Detect the document format of source from its bytes alone.

Never consults a file name or extension. A malformed or ambiguous input (or a format whose adapter is not compiled) falls back to DocumentFormat::Opaque.