getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[nextgen-editor] Creating a table with features #58

Closed PeterB513 closed 3 years ago

PeterB513 commented 3 years ago

I tested the creation of a table and put my results in a video (attached). I changed the cell properties like line style and colour. Displaying the result with preview gives just a line like the end of the video. Grav core, plugins and theme are actual (checked). Peter

https://user-images.githubusercontent.com/77876165/109421033-dc8aa200-79d5-11eb-9a8b-396e7f8f264e.mov

rhukster commented 3 years ago

The table editing functionality relies on HTML to add inline style to the table elements. It is normal that these kinds of features are stripped out in NextGen, as it converts the HTML table to markdown, which does not support these kinds of things. However, it should render as a table on the site, but I think that's mainly due to the empty cells used in your test. I think that is a bug in how we save the markdown, it should have at least a space between the | elements.

w00fz commented 3 years ago

This is not an issue with NextGen and it's not related to the blank spaces between |. You can tell because NextGen has no issues reloading and recognizing the table after a Save.

The problem is with Grav and the markdown parser used. Grav's markdown requires a table header to be present in order for the parser to be able to recognize it as a table and then render it in frontend.

To work around the limitation you can enable a table row as header in NextGen very easily (see video below) and once you do that and save, it will render a table properly in frontend.

https://user-images.githubusercontent.com/11734/115162547-0452c980-a059-11eb-9cd1-37df1b254b8e.mp4

If you are not looking to have an header, you can workaround that by creating an empty table header like:

w00fz-2021-04-18_@_15 17 42@2x