Awesome frontmatter (#617)

Live Frontmatter Templates
This commit is contained in:
Zef Hemel
2024-01-04 20:08:12 +01:00
committed by GitHub
parent 9040993232
commit 91027af5fe
53 changed files with 646 additions and 342 deletions
+3 -2
View File
@@ -166,8 +166,9 @@ export function shouldRenderAsCode(
if (mainSelection.empty) {
return checkRangeOverlap(range, [mainSelection.from, mainSelection.to]);
} else {
// If the selection is encompassing the fenced code we render as code
return checkRangeSubset([mainSelection.from, mainSelection.to], range);
// If the selection is encompassing the fenced code we render as code, or vice versa
return checkRangeSubset([mainSelection.from, mainSelection.to], range) ||
checkRangeSubset(range, [mainSelection.from, mainSelection.to]);
}
}