Serum
Serum copied to clipboard
Escape & in anchors
In "manually" tidying the generated HTML, i stumbled upon the following issues reported by tidy:
line 36 column 205 - Warning: unescaped & or unknown entity "&-voxpupuli"
line 37 column 1011 - Warning: unescaped & or unknown entity "&-s-it"
this tells me that we need to escape, or skip &
when using it in anchors.
Thank you for your report! Where did you find those strings? In id
attribute of HTML tags? For example:
<h2 id="&-voxpupuli" ...>...</h2>
Thank you for your report! Where did you find those strings? In
id
attribute of HTML tags? For example:
yup, although it looked more like:
<h2 id="puppet-&-voxpupuli" ...>...</h2>
funnily enough, this happens whether my markdown says:
## Puppet & Voxpupuli
or
## Puppet & Voxpupuli
Yes, that's becuase of how Serum generates element IDs based on text contents of <h*>
tags. I'll find out how to properly normalize those ID values.
One thing to ask, what version of Serum are you using? I cannot reproduce this problem on my side. If you are using an old version, please update it and try again. (Better escaping of anchors will be implemented anyway, though.)
defp deps do
[
{:serum, git: "https://github.com/Dalgona/Serum.git", branch: "master"},
]
end
I see, you were on a bleeding edge! To make sure you're using the latest commit of Serum v1, Please try updating your deps to...
defp deps do
[
{:serum, git: "https://github.com/Dalgona/Serum.git", branch: "v1/master"},
# ...
]
end
Clean (or delete) your deps
directory, fetch your dependency again using mix deps.get
, and see if the problem still persists.
Your website is now ready!
Copy(or move) the contents of `site` directory
into your public webpages directory.
tidy -config tidy.config site/*.html || true
looking good.
Glad to hear that.
I'm leaving this thread open since there are some other quirks related to encoding HTML entities.