Shortcodes
<%* const emojiMap = { "📖": "📖", "📎": "📎", "💻": "💻", "⭐": "⭐", "🔈": "🔊", "💡": "💡", "⚙": "⚙️", "🔑": "🔑", "🔥": "🔥", "👍": "👍", "❇": "✨", "🚀": "🚀", "🏆": "🏆", "📧": "✉️", "📆": "📆", "🔧": "🔧", "🔨": "🔨", "🔍": "🔍", "📦": "📦", "📋": "📋", "🔒": "🔒", "🔓": "🔓", "🔗": "🔗", "⚠": "⚠️", "ℹ": "ℹ️", "📌": "📌", "🚨": "🚨", "✅": "✅", "⚡": "⚡", "🛑": "🛑", "🚫": "🚫", "🎓": "🎓", "✒": "✒️", "📓": "📔", "©": "©️" };
// Function to replace all GFM shortcodes with emojis function replaceShortcodes(text) { return text.replace(/:\w+:/g, match => emojiMap[match] || match); }
// Get active file content and replace shortcodes const activeFile = app.workspace.getActiveFile(); if (activeFile) { const fileContent = await app.vault.read(activeFile); await app.vault.modify(activeFile, replaceShortcodes(fileContent)); } %>