Manual summary divider isn't working (like I expected)

Hi again.

I read in documentation about the <!--more-->:

Alternatively, you may add the <!--more--> summary divider where you want to split the article. Content prior to the summary divider will be used as that content’s summary, and stored into the .Summary variable with all HTML formatting intact.

Well… seems like that isn’t completely exact.

First, it wont work with shortcodes. Like example, {{% figure parameters %}}. If you use Markdown in title or caption parameter, it will simply ignore the format.
I needed to customize the figure shortcode for really preserve the HTML formatting, using the markdownify function:

<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
    {{ with .Get "link" }}<a href="{{.}}">{{ end }}
    <img alt="{{ with .Get "alt" }}{{.}}{{ end }}" src="{{ .Get "src" }}" />
    {{ if .Get "link" }}</a>{{ end }}
    {{ if or (.Get "title") (.Get "caption") }}
    <figcaption>
        {{ with .Get "title" }}<p class="title">{{.|markdownify}}</p>{{ end }}
        {{ with .Get "caption" }}<div class="caption">{{.|markdownify}}</div>{{ end }}
    </figcaption>
    {{ end }}
</figure>

(not just because of that: I’m used to reStructuredText figure directive and wanted to achieved something similar [still on it]).
With that, I get my markdown in this shortcode correctly parsed almost always. Almost, because there is the second and main problem: “divided” markup.
I mean, like example, the use of reference links.
I like them, because the text seems more clear and tidy to me.

But when you write something like:

Bla bla bla bla [this is a link][this is their label]
bla bla bla [^1]
<!--more-->
[this is their label]: http://this-is-the-url.domain
[^1]: Text of the footnote

Well: you get a summary without your wanted HTML :(.

And yes: you can avoid this (even if is ugly) using normal links in the summary part, yeah.
But then, you notice the footnote is also broken. And this hasn’t an easy solution like the links problem. Well: you can also place the divider just before the footnote. But that’s you giving up your writing freedom, right?

I don’t know how hugo works, but, if you want to create summaries retaining the HTML formating for real, shouldn’t you first convert markdown to HTML and, only after that, get the excerpt you want for summary?
The Markdown generates the right HTML (except the shortcode part, you still will need the markdownifyfunction) in full pages, so it seems that hugo first get the excerpt and, later, converts it to HTML. And, because of that, you get this kind of markup broken.

It’s just me or this is a general problem?
Should I report a bug issue about this?

At the time being, I’m just trying to avoid this problems with the mentioned workarounds, but it doesn’t feel good >_<.

Thanks for your time!

hugo version:

Hugo Static Site Generator v0.13 BuildDate: 2015-04-20T21:17:06+02:00

If I read you correctly, your main problem is markup that cross borders, i.e. your example:

Bla bla bla bla [this is a link][this is their label]
bla bla bla [^1]
<!--more-->
[this is their label]: http://this-is-the-url.domain
[^1]: Text of the footnote

I haven’t looked at this code for a while, but I’m pretty sure that the Summary and the CompletePage is rendered as two separate entities.

The alternative would fix your problem, but add a loads of others. In your case we not only had to do some magic split of HTML, but also magically handle the footnote linking from a random Node to the actual page …

PRs that handle this in a simple way is welcomed.

Yeah. That’s the problem.
About this:

but also magically handle the footnote linking from a random Node to the actual page

I thought that the unique identifiers being added automatically to the refs would get that straigth, but yes: if the pages are independently rendered, that’s another problem ^_^U.

I can’t contribute with PRs, just because I don’t know Go.
Well, I guess I will try to avoid the known problem with the mentioned workarounds :).

In any case, I’m pretty happy with Hugo for the time being n_n. I’m still configuring this thing and porting my old blog posts from reStructuredText in Pelican to Hugo, but it seems very promising, featureful and customizable without much hassle. Shortcodes, like example, are pretty useful.

Thanks for your time ;).

The footnote linking isn’t the biggest problem … This could be done, but it’s a fairly big task and I’m not convinced it’s worth it. We may also take a performance hit etc.

That said,

Please create a GitHub issue – maybe some days of thinking will solve this.