3 ms·
> maybe try copy+pasting that URL That doesn't work either, because the generator dropped the underscore. http://en.wikipedia.org/wiki/Flip-flop_(electronics)
by jwilk 5y ago
> maybe try copy+pasting that URL
That doesn't work either, because the generator dropped the underscore.
http://en.wikipedia.org/wiki/Flip-flop_(electronics) http://en.wikipedia.org/wiki/Flip-flop_(electronics)
Hugo would normally handle such links fine, but earlier on there's an unescaped underscore in "d_out", which makes it go off the rails.
- shadowgovt 5y agoAnd hugo is technically correct (the best kind of correct) in that parens are in the sub-delims reserved set of characters for HTML (https://www.ietf.org/rfc/rfc3986.txt https://www.ietf.org/rfc/rfc3986.txt section 2.2), and since they're being used in a context where the enclosing language considers parens to have special meaning, they should be octet-encoded in the hugo file. (In practice, my experience with hugo is that it will generally get them right if you use them anyway, but it risks mis-parsing).
- jwilk 5y agoOn the contrary, because parentheses are reserved, percent-encoding them is not necessarily safe: > Percent-encoding a reserved character, or decoding a percent-encoded octet that corresponds to a reserved character, will change how the URI is interpreted by most applications. https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
- shadowgovt 5y agoThat is, unfortunately, one of those chunks of English that is hard to interpret. "Safe" here isn't really what the RFC is talking about; the RFC is saying that if you take a URI and add or remove percent encoding for those characters, you might change the way that the URI is interpreted (because those characters mean something in the enclosing context). In other words, you can't encode or decode them without risking a change to the interpretation, but whether encoding or decoding is "safe" is going to be context-specific (broadly speaking, the safest thing to do is to encode them and leave them encoded).
- jwilk 5y agoIt happens that Wikipedia doesn't care whether parens are percent-encoded or not. So yes, you can use %28%29 instead (), but that's despite them being sub-delims. For example, you definitely should change & (another sub-delim) to %26 in your URLs. And, as I noted earlier, escaping parens wouldn't even help in this case, because it's an underscore that causes the mess.