ClearResults removes styles from HtmlHead
Hello!
When using Util.HtmlHead.AddStyles
, LINQPad will remember the injected HTML header content so that repeated calls with the same string will not result in duplicated injections. This is all good and works pretty well.
However, when using Util.ClearResults()
to clear the results panel, these injected styles are also removed and even if you have calls to AddStyles
, the styles are still not readded (since they are still cached).
Here’s a quick example:
Util.HtmlHead.AddStyles(".test { color: red; }"); Util.WithCssClass("Test!", "test").Dump(); Util.ClearResults(); Util.HtmlHead.AddStyles(".test { color: red; }"); Util.WithCssClass("Test!", "test").Dump();
It would be nice, if this could be modified that either ClearResults
will readd the cached injected headers or that it will clear the cache so that later calls to AddStyle
can readd the headers.
Comments
-
Ctrl+Alt+X
andF5
produce different results. MultipleF5
s are inconsistent when executed afterCtrl+Alt+X
. LINQPad 8 Windows beta.Util.HtmlHead.AddStyles(".test { color: red; }"); Util.WithCssClass("Test!", "test").Dump(); Util.ClearResults(); "----".Dump(); // Added Dump to create HTML, without it multiple `Ctrl+Alt+X`s are inconsistent. Util.HtmlHead.AddStyles(".test { color: red; };"); // Appended ; to style, otherwise there is no effect. Util.WithCssClass("Test!", "test").Dump();
-
Thanks for the repro. It should be fixed in 9.1.6. Let me know how you get along.
-
That seems to work just fine, thank you! 😊
Now I just need to get my license updated earlier than planned to switch to version 9 😅