A white space disappearing, despite no {{-

Hi, I have the opposite problem that I used to… A white space is scrubbed out, while using no {{- nor white-space css property.

Hanard Gilbertin Inceste et société romaine républicaine

There should be a space between Gilbert and “in”. The markdown is ```quote{author="Hanard Gilbert" cite="Inceste et société romaine républicaine"}
While render-codeblock-quote.html goes:

{{ $author := .Attributes.author  }}
{{ $class   := .Attributes.class }}
{{ $complex   := or (or $author (or .Attributes.cite .Attributes.id)) (not (in $class "simple")) }}
<blockquote {{with .Attributes.id}}id={{.}} {{end}}{{with $class}} class="{{.}}"{{end}}{{if in .Attributes.cite "]("}} cite="{{strings.TrimSuffix ")" (index (last 1 (split .Attributes.cite "](")) 0)}}"{{end}}>{{ .Inner|$.Page.RenderString }}</blockquote>
{{ if or $author .Attributes.cite }}<div {{if in .Attributes.class "aside"}}class=aside{{end}}>{{with $author}}<address>{{.|$.Page.RenderString}}{{end}}</address>{{with .Attributes.cite}}<cite> in {{.|$.Page.RenderString}}</cite>{{end}}</div>{{end}}

The html produced is

<div><address>Hanard Gilbert</address><cite>in Inceste et société romaine républicaine</cite></div>

Indeed without the space. So it’s not a matter of css.

Not a Hugo nor a CSS issue, but typical HTML behaviour:

<cite>    whitespace at the start is omitted</cite>

TLDR: ALL the whitespace at the start of an HTML element gets removed by your browser conform the HTML spec.

3 Likes

I’m curious why you’d output author name to an address element?

Oh, I was under the impression the standard forbad using <cite> for authors, but it seems that I was wrong, and I can. so problem solved, and more exactly, eschewed.
I didn’t know about the trimming either.

The cite element should be used for the source of the quotation, i.e. where the author made the quote. The cite attribute would be used for a link to that source.

The author name should be output to a figcaption element, which is associated with the blockquote by an enclosing figure element. Detailed examples of blockquotes in the html spec.

Yeah I used to that first but that makes the code useless complicated. If anything I would put cite INSIDE blockquote. I personally do not see why on the semantic element for the source of the quotation should be treated any differently as the one for the author. The authorities mentioned in the link do not agree with one another, so at is said, it’s up to the webmaster. Your interpretation, is only one among two, so I’ll stick with the one I vibe with :upside_down_face:
The cite attribute is always correct, it’s the most important.

It makes the code correct.

That would be incorrect. The html spec is very clear:

Attribution for the quotation, if any, must be placed outside the blockquote element.

It’s different information. The cite element has very clear, docuemented, uses. If you want to use the wrong html that is up to you, html is quite forgiving in that respect. It would clearly be incorrect though.

It isn’t though is it? It’s literally the html spec, not my interpretation. Not sure what the second interpretation you refer to is.

Not sure what you mean here. You don’t seem to be using the cite attribute.

I do:

{{if in .Attributes.cite “](”}} cite=“{{strings.TrimSuffix “)” (index (last 1 (split .Attributes.cite “](”)) 0)}}”{{end}}

How dare you prove me wrong ?! :rofl:
Okay what the guy wrote is ßhîþ, his quote that supposedly allows author is not the page he links to. Sorry. Then I’ll use <p>author <p>in <cite>source</cite></p> and call it a day.