Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Changes for interactive plantuml #2754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bharatrajagopalan wants to merge 6 commits into requarks:main
base: main
Choose a base branch
Loading
from bharatrajagopalan:dev

Conversation

Copy link

@bharatrajagopalan bharatrajagopalan commented Nov 24, 2020

This is a copy of the original pull request here

Creating this pull request on dev branch as discussed with @NGPixel . I had originally created this a while ago by forking the master branch and hence needed to rewrite this using DOMPurify.

Summary:
Plantuml is currently created as an image which means that links do not work and the plantuml content is treated as a picture and is not searchable

This PR does the following:

  • Renders plantuml as svg using object tag so that it is interactive and selectable (e.g. you can now copy paste text from within the diagram) with a backup non-interactive img tag if browser will not render object
  • Places the original plantuml content inline inside the object tag to ensure that this is not visible but included in wikijs search index

As object tag is typically insecure, it is checked and sanitised to make sure that

  • Only the configured plantuml server, image format (e.g. https://plantuml.requarks.io/svg/) are allowed in the url parameter passed in data; Any other value results in the node being discarded
  • Only attributes required for plantuml+wikijs are allowed (style/class/type/data/alt); mismatch in number of attributes being passed in will result in the node being discarded.
  • Allowed attributes other than data are overriden to the required values for plantuml to work with wikijs explicitly to avoid any code injection scenarios

Tested using sample markdown

mbedded reacted with thumbs up emoji
Copy link

any idea when it could be merged? I need this! :D

ibm-omnicron, mbedded, bharatrajagopalan, tonnesfn, Culminate, jaya-drungilas, and Philmen reacted with thumbs up emoji

Copy link

ImBoop commented Sep 6, 2022

Requesting a followup on this, one year later!

Copy link

+1 for this. The interactivity is a must for plantuml-C4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@NGPixel NGPixel Awaiting requested review from NGPixel

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /