tlienart / Franklin.jl

(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
https://franklinjl.org
MIT License
932 stars 108 forks source link

<br/> elements In html blocks are removed in production #1041

Closed jasoneveleth closed 10 months ago

jasoneveleth commented 10 months ago

I have this code block:

~~~
<details class="d"><summary class="s">
<strong>b</strong> 7a9b89fa674b0b703eaafca2e79e474a55...
</summary>
<strong>a.txt</strong> 86bfc753650b4b730b7177b9e665dbe100...</br>
<strong>b.txt</strong> 86bfc753650b4b730b7177b9e665dbe100...</br>
<strong>c.txt</strong> a380d5f755183c7c0f05a327e7094c9e98...</br>
<strong>d.txt</strong> a380d5f755183c7c0f05a327e7094c9e98...</br>
<strong>e.txt</strong> 5c836f02b0d2653274fefab5e108d3e78c...</br>
<strong>f.txt</strong> ecef6bf3c9100c87aaeb4fae46b23f23d6...</br>
<strong>g.txt</strong> 9d1af65406716fd984b640f7f24b43ccd6...</br>
<strong>j.txt</strong> 79a2f595545dd08b508c2a808e543befcb...</br>
</details><style>:root{--l: 25px}details > details{margin-left: var(--l);}.s{margin-left: calc(0px - var(--l))}.d{font-family: monospace;margin-left: var(--l);font-size: 70%;}details > strong{font-weight: 700;}</style>
~~~

When I use using Franklin; serve(prerender=true) everything works, but when I push to github and it does minification and everything, the <br/> elements disappear. Is there a workaround? You can see them disappear on my website at the bottom.

tlienart commented 10 months ago

the python minifying script that Franklin uses is a bit crap and it's probably a good thing to just turn it off with optimize(..., minify=false); in addition it doesn't help that much if you use github for deployment as github already basically acts as an optimiser serving pages via gzip (at least it used to but I don't see why it wouldn't anymore).

prerendering is a bit better but if you want to be sure what you see locally is what you get remotely, just turn both minify=false, prerender=false in the call to optimize (which isn't much of an optimize pass then 😄 )

in the next version of Franklin this stuff is just removed (though there's the use of a minification jll in discussion)

jasoneveleth commented 10 months ago

Thank you.