mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
improved error handling
This commit is contained in:
@@ -895,6 +895,10 @@ async function asyncPostProcessContent(note, content) {
|
||||
|
||||
// all keys should be replaced by the corresponding values
|
||||
function replaceByMap(str, mapObj) {
|
||||
if (!mapObj) {
|
||||
return str;
|
||||
}
|
||||
|
||||
const re = new RegExp(Object.keys(mapObj).join("|"),"g");
|
||||
|
||||
return str.replace(re, matched => mapObj[matched]);
|
||||
|
||||
Reference in New Issue
Block a user