gmunguia / markdown-it-plantuml

:herb: :book: plantuml diagrams in your markdown
MIT License
98 stars 21 forks source link

Support parsing ```plantuml code block in markdown #11

Closed chuxubank closed 5 years ago

chuxubank commented 5 years ago

vscode-plantuml gives a way to preview plantuml in markdown in vscode. See here

It will be a nice thing to support this feature because there is no need to delete ```plantuml ... ``` when deploy a site.

gmunguia commented 5 years ago

Thanks for creating an issue! I am really busy right now. I will have a look at this in a week or so.

gmunguia commented 5 years ago

Markdown uses ``` to display source code. To me, it is really weird how that plugin uses ``` to actually run the code. After a bit of though, I am not going to integrate this in the library, sorry =(

chuxubank commented 5 years ago

Actually not only vscode-plantuml run the code, in Typora many other diagram plugins also run the code lol, such as Sequence, Flowchart and Mermaid. See here

mmngreco commented 5 years ago

Ohhh it's a pity! Also Gitlab uses this behaviour: https://docs.gitlab.com/ce/administration/integration/plantuml.html

Hipska commented 5 years ago

Yes indeed, please reopen this issue. This syntax is much more clean and compatible with other markdown parsers.

manastalukdar commented 4 years ago

Agree, for sake of consistency with other markdown parsers, please consider reopening this issue.

manastalukdar commented 4 years ago

I ended up writing some custom code to use fenced blocks

```plantuml

as markers. The source code of this plugin was helpful to understand how Markdown-it plugins work, so thanks to the original author.

gossi commented 4 years ago

I use this config:

const config = {
  openMarker: '```plantuml',
  closeMarker: '```'
}

I'd also rather see the fenced version as default, as this allows indentation (which can be very helpful). Anyway regular markdown would treat indentation as code blocks.

jaune162 commented 4 months ago

@gossi This config conflict with hexo's built-in highlighter. Maybe it's not possible to use code blocks for rendering in hexo