Custom Summary Not Accepting Line Breaks?

If I select the custom summary option in the Editor stack, when creating a new post any content put into custom summary box does not honour line breaks or <br>

For instance. If I put this in the box…

Then click save, then edit the post, the custom summary now looks like this…

If I put all the text in with no line break it appears as normal, ie. no text is removed. Essentially, the custom summary seems to only accept a block of text, no line breaks etc.

Is this expected behaviour or a bug?

What happens if you use two spaces instead of the br?

It’s not spaces but line breaks. Anything after a line break is being removed.

But two spaces are a line break in markdown, that is why I suggested this…

Gotchya. Inserting two spaces doesn’t result in the content after the two spaces being removed, but it also doesn’t result in a line break.

A few things –

  • A line space between paragraphs, as @Fuellemann suggests, creates new paragraph <p> tag. It won’t create a line break. Paragraphs are styled to have margin on the bottom, which makes it appear you’ve added a <br> because of the empty line.
  • Two empty lines does not create a <br> or an extra <br>. In fact it does not even create an empty <p> tag pair. Why? Because the editor is smart enough to know not to insert a random, errant, empty <p> tag pair.
  • The Custom Summary is different from the main body. The main body of the blog post can handle different HTML markup and what not as it is in the body of the Markdown file. The Custom Summary will handle only Markdown for the most part. This is because it is a custom field within the YAML of the blog post’s Markdown file. This is by design so that we can reload the Custom Summary in the Editor as something separate from the main blog post’s body content.

TL;DR – don’t use HTML markup, video embeds, etc in the Custom Summary field.

Sorry, but does that mean the behaviour described above is expected?

You can try \n I have seen that in a YAML documentation.

No, that didn’t seem to work either.

I have heard of YAML, but I’m not familiar with it. I’ve just done a bit of reading up on it, but I’m still not sure if I should be able to put a line break in the custom summary box (and so the issue described above is a bug), or if it’s designed in such a way that only a block of text (no line breaks) is possible. Hopefully @elixirgraphics can clear that up for me?

@TemplateRepo Have you testet </br>? Dont use<br> Works for me.

That didn’t work me either. I wonder, are you putting it into the custom summary area of the body text area?

1 Like

Ha! </br><br> worked! Nice one.

Maybe this is how it’s intended to work. We’ll see what Adam says.

EDIT: I actually cocked up earlier, </br> does work, I was just having brain fade.


Converts to this…

Which is exactly what I was after. Thanks for the help folks.

(Still curious if this is how it’s meant to work though!)


<p> </p>

1 Like

Good morning all –

Sorry I don’t think I’m clear on what you’re asking. Or maybe I just didn’t explain myself clearly enough before. Sorry if that is the case.

Putting HTML markup in the Custom Summary field should not be done. Your results you are seeing are neither expected or not expected. The Custom Summary isn’t designed to have HTML markup placed within it.

HTML Markup in the Custom Summary field would also include a space between paragraphs as that creates HTML markup. The Custom Summary field was not intended to have more than a Summary block of text. I can look at encoding it to allow this in the future. I don’t know if it will be possible or not.

As for some of the other questions, suggestions, etc posted yesterday:

This will not work within the field, as it all gets wrapped in quotation marks when it is written to the file.

</br> is not valid HTML markup.

Like I said though, the Custom Summary field is only designed for a block of text, using Markdown. Adding HTML markup to it, in whatever fashion, will have undesired results. I will look at this in a future update to see what is possible, but as of now this is how it is made to work.

Before I started to add in all the code options, I inserted a line break by simply hitting carriage return on the keyboard. But it didn’t work; the text after the return got removed. So my question was, is this expected, as in, are we not able to put he text in the summary over more than one line?

And I think this answers the question: Blocks of text all on the same line, no line breaks, no matter how they are inserted?

Yeah. I’m looking at the code now to see if it would be possible to do. I think so, but I’ll have to experiment with it a bit. It’ll take juggling it between HTML and Markdown in the Editor probably.

Even if it is a possibility, don’t expect it in the next update. If I happen to get it in the next update it would be a pleasant surprise for us both. But the next update already has a lot going on.


@elixirgraphics an I add a feature request for Alloy to this thread, instead of starting a new one?

Can you add to the layout options for Alloy the option to have a row of three, following by a row of two, followed by a row of three, etc.?

The way the layouts are generated is more complex than they may seem on the surface as they have to take a lot of the user selected features and possibilities into consideration. Adding one is quite a bit of work. I’ll note this as a feature request, but this definitely will not be in the next update though.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.