Code Monkey home page Code Monkey logo

Comments (3)

aloisklink avatar aloisklink commented on June 10, 2024 1

I suppose this line about not rolling your own markdown parser proved to be prophetic 😉

😆

The main reason we haven't switched yet is that:

  • There are many implementations of Markdown, and we don't want to just support GFM when people might be using Pandoc markdown (or some other arbitrary Markdown spec)
  • We didn't want to make breaking changes for existing users.

However, we're planning on making a v11 release once Mermaid makes a v11 release, and we're planning on finally dropping support for Node.JS v14 & Node.JS v16. So dropping support for some more unusual Markdown implementations might be okay too.


As a temporary measure, here are two remark plugins that actually use a real markdown parser that you can use:

from mermaid-cli.

PizzapunkDev avatar PizzapunkDev commented on June 10, 2024 1

Sounds like a plan! My toolchain involves pandoc for manipulating and combining markdown files before running mermaid-cli, so for future Googlers in the same situation for now, my solution was to write a very crude Lua filter to 'process' the mermaid code blocks explicitly:

function CodeBlock(elem)
    local language = pandoc.utils.stringify(elem.classes)
    if FORMAT:match 'gfm' and language == 'mermaid' then -- don't forget to change the markdown format here or make this more generic if needed
        return {
            pandoc.RawInline('markdown', '```mermaid'), -- basically just hardcode the block without the space
            pandoc.RawBlock('markdown', elem.text),
            pandoc.RawInline('markdown', '```')
        }
    end
    return elem
end

from mermaid-cli.

PizzapunkDev avatar PizzapunkDev commented on June 10, 2024

I suppose this line about not rolling your own markdown parser proved to be prophetic 😉

from mermaid-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.