Skip to content
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

Interactive Plantuml with searchable content #2751

Closed
wants to merge 16 commits into from
Closed

Interactive Plantuml with searchable content #2751

wants to merge 16 commits into from

Conversation

bharatrajagopalan
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

Summary:
Plantuml is currently created as an image which means that links donot work and content is treated as a picture.

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
  • Places the original plantuml content inline inside the object tag so that wikijs search indexes the content for searchability.

As object is typically insecure, it will go through the following checks and sanitisation before being kept

  • Only attributes that are required for plantuml are allowed.
  • If any of the required attributes are missing then the node is discarded
  • the data attribute must start with the URL/sub domain of preconfigured plantuml server and image type (e.g. svg) in wikijs config (e.g. https://plantuml.requarks.io/svg)
  • if the above checks pass then allowed attributes other than data are reset to required values for plantuml processing

Tested using sample markdown

@bharatrajagopalan
Copy link
Author

Closing this pull request - will squash the commits to make it more readable and open a new one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant