mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-07-23 10:30:36 +00:00
Fix bug with callout block rendering
This commit is contained in:
parent
43a42a70f5
commit
ce3cbedd2e
@ -151,10 +151,15 @@ module.exports = function(eleventyConfig) {
|
||||
|
||||
|
||||
eleventyConfig.addTransform('callout-block', function(str) {
|
||||
return str && str.replace(/<blockquote>((.|\n)*)<\/blockquote>/g, function(match, content) {
|
||||
return str && str.replace(/<blockquote>((.|\n)*?)<\/blockquote>/g, function(match, content) {
|
||||
let titleDiv = "";
|
||||
let calloutType = "";
|
||||
content = content.replace(/\[!(\w*)\](\s?.*)/g, function(metaInfoMatch, callout, title) {
|
||||
const calloutMeta = /\[!(\w*)\](\s?.*)/g;
|
||||
if(!content.match(calloutMeta)){
|
||||
return match;
|
||||
}
|
||||
|
||||
content = content.replace(calloutMeta, function(metaInfoMatch, callout, title) {
|
||||
calloutType = callout;
|
||||
titleDiv = title.replace("<br>", "") ?
|
||||
`<div class="admonition-title">${title}</div>` :
|
||||
|
Loading…
x
Reference in New Issue
Block a user