# \[Publish\] I found a way to force markdown inside code blocks

**URL:** <https://forum.obsidian.md/t/publish-i-found-a-way-to-force-markdown-inside-code-blocks/27717>\
**Category:** Workflows & Templates\
**Tags:** publish\
**Created:** [November 26, 2021, 6:27pm UTC](https://forum.obsidian.md/t/publish-i-found-a-way-to-force-markdown-inside-code-blocks/27717 "2021-11-26T18:27:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mara-Li](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mara-li/32/12591_2.png) [@Mara-Li](https://forum.obsidian.md/u/Mara-Li)\
**Post date:** [November 26, 2021, 6:27pm UTC](https://forum.obsidian.md/t/publish-i-found-a-way-to-force-markdown-inside-code-blocks/27717/1 "2021-11-26T18:27:11Z")

</div>

Okay, so, for two month, I test Publish to help my classmate during our revision and examen.

As I use _a lot_ Admonition, I use the publish.js to render my admonition. Unfortunately, It doesn’t support markdown…  
Until I work a day on it.  
(A day because I forgot to edit _one_ word)

So, how can I do that ?

I first add :

```js
function injectScript(src) {
        return new Promise((resolve, reject) => {
        const script = document.createElement('script');
        script.src = src;
        script.addEventListener('load', resolve);
        script.addEventListener('error', e => reject(e.error));
        document.body.appendChild(script);
    });
}

injectScript('https://cdn.jsdelivr.net/npm/marked/marked.min.js')
    .then(() => {
        console.log("script loaded");
    }).catch(error => {
    console.log(error);
    });

```

In the start of my publish.js file.

After, I looking for a lot and edit the `admonitionContent.innerHTML = content;` in `processAdmonitionBlock`.  
The new line is ` admonitionContent.innerHTML = marked.parse(content);`

And I do some… Try.

Also, note : it doesn’t work with Wikilinks (obviously).

 ![image](https://forum.obsidian.md/uploads/default/original/3X/0/f/0fa0911e08709477b5baf43db6c5b58ccad88933.png)

You can see here the live rendering :  
[Live rendering](https://www.mara-li.fr/10.+Master/_Memento/Surveillance)

For the moment my problem is around the way Obsidian charge the JavaScript, but I think this trick can help on some Jekyll template, to force admonition view.

> It is possible that you need to reload two times to get the parser to work.
