Skip to content

Disable copy-code button for mermaid diagrams

Dheeraj Joshi requested to merge djadmin-remove-mermaid-copy-code-btn into master

Related issues - #349497 (closed), #349892 (closed)

What does this MR do and why?

It removes the copy-code button for mermaid diagrams, fixing #349497 (closed), and potentially #349892 (closed) also.

It was added in !75433 (merged), and intended for only code blocks and not the mermaid diagrams I suppose.

Screenshots or screen recordings

  1. Copy clipboard button
before after (renders only for code block)
image image
  1. Mermaid diagram rendering issue
Intermittent issue (both diagrams are not rendered) Intermittent issue (one diagram is not rendered) After fix
image image image

How to set up and validate locally

  1. Create a new issue / MR with the following comment
  2. Enclose it with mermaid ...
sequenceDiagram
    User->>GitLab: GET /project/-/archive/master.zip
    GitLab->>User: 302 Found
    Note over User,GitLab: Location: https://cdn.com/project/-/archive/master.zip?token=secure-user-token
    User->>CDN: GET /project/-/archive/master.zip?token=secure-user-token
    alt object not in cache
      CDN->>GitLab: GET /project/-/archive/master.zip
      Note over CDN,GitLab: X-Gitlab-External-Storage-Token: secure-cdn-token<br/>X-Gitlab-Static-Object-Token: secure-user-token
      GitLab->>CDN: 200 OK
      CDN->>User: master.zip
    else object in cache
      CDN->>GitLab: GET /project/-/archive/master.zip
      Note over CDN,GitLab: X-Gitlab-External-Storage-Token: secure-cdn-token<br/>X-Gitlab-Static-Object-Token: secure-user-token<br/>If-None-Match: etag-value
      GitLab->>CDN: 304 Not Modified
      CDN->>User: master.zip
    end
graph LR; A-->C;

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dheeraj Joshi

Merge request reports

Loading