adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
10.26k stars 2.72k forks source link

[Bug]: HTML 输出未被正确解析的问题(Issue with HTML output not being parsed correctly) #1615

Closed Mini-Jelly closed 1 week ago

Mini-Jelly commented 1 month ago

What happened?

Issue with HTML output not being parsed correctly 2024-10-12_15-44-36

Steps to reproduce

1.run cmd

hugo new site 123
cd 123
move D:\hugo.exe D:\123\
echo theme = 'hugo-PaperMod-7.0' >> hugo.toml

2.Put the downloaded theme into the folder theme in the 123 folder

3.Create some new articles

4.I asked ChatGPT how to solve it

on "themes\PaperMod\layouts\partials" Line 20

{{- delimit . " · " -}}      ------>     {{- safeHTML (delimit . " · ") -}}

ChatGPT:In the last line of post_meta.html, wrap the result of delimit in the safeHTML function. This will ensure that the output HTML is parsed correctly.

The result of this modification is that ChatGPT answered

Hugo Version

Hugo >= 0.112.4 (Recommended - Minimum version required for PaperMod)

PaperMod Version

PaperMod v7.0

What kind of devices are you seeing the problem on?

Desktop

What browsers are you seeing the problem on?

Chrome

Browser Version

Chorme 121.0.6167.185

Relevant log output

D:\hugo>hugo --gc
Start building sites …
hugo v0.135.0-f30603c47f5205e30ef83c70419f57d7eb7175ab windows/amd64 BuildDate=2024-09-27T13:17:08Z VendorInfo=gohugoio

WARN  deprecated: .Site.Social was deprecated in Hugo v0.124.0 and will be removed in a future release. Use .Site.Params instead.

                   | EN
-------------------+------
  Pages            | 147
  Paginator pages  |  11
  Non-page files   |   0
  Static files     |   0
  Processed images |   0
  Aliases          |  42
  Cleaned          |   0

Total in 169 ms

Repository/Source Code link where this issue can be reproduced

No response

Code of Conduct

Mini-Jelly commented 1 month ago

hugo v0.135.0-f30603c47f5205e30ef83c70419f57d7eb7175ab windows/amd64 BuildDate=2024-09-27T13:17:08Z VendorInfo=gohugoio

newptcai commented 3 weeks ago

I had the same problem. Solved by update PaperMod via:

git submodule update --remote

adityatelange commented 1 week ago

fixed long ago. pls pull v8 or master