GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
26.98k stars 3.86k forks source link

Custom blocks not processing what's inside them #1468

Closed aniav closed 5 months ago

aniav commented 8 years ago

What is the current behavior?

Currently if you create a new tag {% myTag %} {% endMyTag %} and put content inside of it you will have it completelly unprocessed. So if there are any links e.g. to other pages in the same book they will come out as an unprocessed markdown.

What is the expected behavior?

I believe block tags should process what's inside them and when someone doesn't want the content inside to be processed they should use {% raw %} inside.

I am developing a new plugins for richquites for Django Girls tutorial. Currently you can see the old plugin here at Python Installation and the code for the new one is here

pelted commented 8 years ago

I agree with this completely. Working on a couple of quick plugins and I have run into this wall as well. May be forced to process the Markdown in my plugin directly. One plugin I have is for better block alignment and another is for image thumbnails or rows of image thumbnails. I'd like to be able to use the current processor.

alexpearce commented 7 years ago

This does seem to be quite cubersome at the moment. I'm writing a plugin that effectively wraps block contents in a div, but it seems like I need to parse the block.body myself (through a Markdown and MathJax/KaTeX parser, in my case).

It would be nice if the block's body could be rendered as if it was 'normal' content (including processing by other plugins, like KaTeX).