Skip to content

Incomplete HTML in .AlertTitle and .Text of Blockquote render hooks #12913

@Lruihao

Description

@Lruihao

Reproduce Steps

Given the following Markdown:

> [!NOTE] Hugo

> [!NOTE] _Hugo_
> The world’s fastest framework for building websites

> [!NOTE] **Hugo**

> [!TIP] **Hugo** FixIt

and the following render-blockquote-alert.html

{{ warnf "%s\t%s" .AlertTitle .Text }}

Actual results is .AlertTitle lost the trailing > and .Text in a start <p> without a closing tag:

WARN  Hugo      <p>
WARN  <em>Hugo</em      <p>The world’s fastest framework for building websites</p>
WARN  <strong>Hugo</strong      <p>
WARN  <strong>Hugo</strong> FixIt       <p>

Expected results (complete .AlertTitle and .Text):

WARN  Hugo      <p></p>
WARN  <em>Hugo</em>      <p>The world’s fastest framework for building websites</p>
WARN  <strong>Hugo</strong>      <p></p>
WARN  <strong>Hugo</strong> FixIt       <p></p>

BTW, if content body of alert is empty, .Text return nil seems better.

What version of Hugo are you using (hugo version)?

hugo v0.135.0+extended darwin/arm64 BuildDate=2024-09-27T13:17:08Z VendorInfo=brew

Does this issue reproduce with the latest release?

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions