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

I fixed the plugin :D #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

I fixed the plugin :D #7

wants to merge 6 commits into from

Conversation

reisir
Copy link

@reisir reisir commented Dec 30, 2023

Fixes #6

The only thing required to fix #6 is adding |raw in the twig template. That's it. Four characters. I did a bunch of other stuff while figuring this out. If there's too much stuff and you don't feel like pulling this I can make a simpler PR with less changes.

Changelog:

  • Ran a formatter on the changed files
  • Declared all dependencies (and added tested versions)
  • Refactored id extraction and insertion
  • Now handles invalid id from shortcode eg. grav-id="id with spaces". It generates a new id if the one in parameters is invalid.
  • Add support for id shortcode parameter while keeping backwards compatibility with grav-id
  • Prioritize the id passed through parameters. If there's an id in the shortcode content AND in the parameters, the id is replaced with the one in the parameters.
  • Used twig |escape('js') to escape the options for DataTable. This in combination with JSON parsing the options allows passing more complicated options than just true / false
  • And of course used |raw in the template to output the table as HTML

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.

Plugin does not work at all
1 participant