grist-widget icon indicating copy to clipboard operation
grist-widget copied to clipboard

[renderhtml] The contents of <head><style></style></head> seems to be ignored by the renderer

Open hellpe opened this issue 1 month ago • 1 comments

Hello,

I'm trying to generate some HTML code so I can use the HTML widget in order to print it. However, it seems that CSS code is ignored if it is written in the

block

See the following sample code :

<html>
  <head>
    <style>
      #destinataire {
        text-align: right;
        text-transform: uppercase;
        }
      </style>
    </head>
    <body>
    <p id='destinataire'>
      This should be right-aligned and uppercase
    </p>
    <p style='text-align: right; text-transform: lowercase'>
      This should be also right-aligned but lowercase
    </p>
  </body>
</html>

This is how it should be displayed (tested on the MDN Playground):

Image

However, this is how the Grist HTML Viewer displays it:

Image

Note that for some reason, the Markdown plugin not only renders HTML (I'd expect it to only parse Markdown text) but renders it correctly:

Image

hellpe avatar Oct 30 '25 14:10 hellpe

Thanks @hellpe. This reminds me of this possibly related issue https://github.com/gristlabs/grist-widget/pull/176 - @dsagal what do you think?

paulfitz avatar Oct 31 '25 19:10 paulfitz