Takes the output of 'readLines()' and looks for lang attribute value, stopping if no valid value is found. Typically used on the output of 'handle_rmd_path()'.
detect_html_lang(lines = NULL, lang_tags = langs)The output of 'readLines()' or 'handle_rmd_path()'.
A vector of valid lang subtag values, taken from https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry. Used to confirm whether the lang value is valid.
The lang attribute value if found. Stops if no value found.