Basic cours support #44

Merged
Anri merged 67 commits from cours into main 2024-04-01 18:11:49 +02:00
2 changed files with 2 additions and 1 deletions
Showing only changes of commit 5009626ef3 - Show all commits

View file

@ -212,7 +212,7 @@ pub fn read_file(filename: &str, expected_file: TypeFileMetadata) -> Option<File
/// Deserialize metadata based on a type
fn deserialize_metadata<T: Default + serde::de::DeserializeOwned>(text: &str) -> T {
serde_yaml::from_str(text.trim_matches(&['-', '\n'] as &[_])).unwrap_or_default()
serde_yaml::from_str(text.trim().trim_matches(&['-'] as &[_])).unwrap_or_default()
}
/// Fetch metadata from AST

View file

@ -9,6 +9,7 @@ window.addEventListener("load", () => {
/* Aliases of langs */
const aliases = {
bash: ["fish"],
pascal: ["pseudocode"],
};
for (const lang in aliases) {
hljs.registerAliases(aliases[lang], { languageName: lang });