Giter VIP home page Giter VIP logo

Comments (13)

awanlin avatar awanlin commented on May 30, 2024 2

Hi @jrkt, I've reached out to the TechDocs team to see if they have any ideas.

from backstage.

ady642 avatar ady642 commented on May 30, 2024 1

exact same problem here

from backstage.

awanlin avatar awanlin commented on May 30, 2024

Hi @jrkt, TechDocs uses the DOMPurify library to sanitize HTML and prevent XSS attacks. Pretty sure this is what you are running in to.

from backstage.

jrkt avatar jrkt commented on May 30, 2024

@awanlin that makes sense for the javascript library, but not for the "pre" elements with mermaid classes. Why would it sanitize native <pre> tags? It's also writing it as if no language is specified. DOMPurify strips out "dangerous" HTML which makes me think it would simply just remove things that are present if they are deemed "dangerous". But, it's not stripping anything out. It's simply rendering it as if it doesn't know how to evaluate the mermaid language specified in the code fences.

from backstage.

awanlin avatar awanlin commented on May 30, 2024

You are right, this doesn't even come into play until you run TechDocs:

export const useSanitizerTransformer = (): Transformer => {

You are seeing this issue before that based on your description.

from backstage.

jrkt avatar jrkt commented on May 30, 2024

Correct. The generated site that we publish to a GCS bucket does not have any of the mermaid classes rendered. It's like it is ignoring that plugin. I also tried the mkdocs-export-mermaid-to-svg and had the same result.

from backstage.

awanlin avatar awanlin commented on May 30, 2024

Could something in techdocs-core MkDocs plugin play into this? https://github.com/backstage/mkdocs-techdocs-core

from backstage.

jrkt avatar jrkt commented on May 30, 2024

@awanlin what do you mean?

from backstage.

awanlin avatar awanlin commented on May 30, 2024

Unless you are using the --omitTechdocsCoreMkdocsPlugin flag the techdocs-core plugin gets added to the mkdocs.yml. Your comment - "It's like it is ignoring that plugin" - made me think maybe it's doing something odd. It does contain a bunch of other MkDocs plugins itself.

from backstage.

jrkt avatar jrkt commented on May 30, 2024

Adding that flag got me what I wanted generated for the site. The only problem now is that turning off the core plugin, now the techdocs content page just loads forever. Have there been any reported issues with that flag?

from backstage.

awanlin avatar awanlin commented on May 30, 2024

So the techdocs-core plugin is not optional, you need it for TechDocs to work. The docs for sure don't make that as clear as they could, or really at all. As far as that flag goes, I'll be honest, it's sort of contradictory to that fact. Essentially the flag assumes that you have the techdocs-core plugin in your config and won't add it.

BUT this at least tells us that the issue is with something in the techdocs-core plugin. Now what that might be I'm less helpful around as I've never dove into that side of things. I've been lucky enough that it just worked for me needs in the past.

from backstage.

jrkt avatar jrkt commented on May 30, 2024

Who would be a better person to bring into the conversation that is knowledgeable about the techdocs-core plugin? It just seems like it's ignoring any plugins provided in mkdocs.yml

from backstage.

ady642 avatar ady642 commented on May 30, 2024

when I use kroki plugin it works like said in the backstage doc, but not with mermaid2 plugin

from backstage.

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.