md2star.preprocessing.language module

Language detection and lang / date_format metadata mapping.

A best-effort guess via the langdetect package; returns None when langdetect is unavailable so the caller can skip metadata injection without crashing.

Author

[Warith HARCHAOUI](https://linkedin.com/in/warith-harchaoui/)

md2star.preprocessing.language.get_language_metadata(content)[source]

Return {'lang': ..., 'date_format': ...} or None.

Strips fenced code blocks, HTML tags, and link targets before detection so only prose is fed to the language guesser.

Parameters:

content (str)

Return type:

dict | None