Coder Social home page Coder Social logo

Comments (3)

AmazingRise avatar AmazingRise commented on June 8, 2024

Thanks for the issue.
In fact, it is a default behavior, again.
Hugo will add an <li> to every task list item. That produces an ugly big black circle point.

Take your test case as example, the final rendering result is:

<ul>
<li><input checked="" disabled="" type="checkbox">task1</li>
<li><input disabled="" type="checkbox">task2</li>
</ul>

My Hugo version is Hugo Static Site Generator v0.63.2/extended linux/amd64.
The most difficult point is, I can't define the style of <ul> <li> in task list seperately. If I define them in CSS, normal list will also be influenced.

Interestingly, I found a 3rd-party Hugo tutorial, and the <ul> in this case is with a class named task-list. But I can't reproduce in my environment. Maybe a deprecated feature in old version?

Furthermore, I checked the implementation in other themes. No implementations at all 😂️.
So I think this issue could be raised to Hugo official - let them add a class property to task list's ul, so we can define the style.

from hugo-theme-diary.

AmazingRise avatar AmazingRise commented on June 8, 2024

I did a further search.

I searched task-list in Hugo source code, and found that only in blackfriday, the old default markdown renderer, can produce a ul with task-list class.

I set defaultMarkdownHandler to blackfriday in my top level config.toml:

[markup]
defaultMarkdownHandler = "blackfriday"

And as expected, I got a <ul> with task-list class attached.

<ul class="task-list">
<li><label><input type="checkbox" checked="" disabled="" class="task-list-item"> task1</label></li>
<li><label><input type="checkbox" disabled="" class="task-list-item"> task2</label></li>
</ul>

So thanks for raising this problem, and I will open the issue.

(Opened, here: gohugoio/hugo#6837)

And please don't close this issue. I will add it back as soon as Hugo official fix this issue.

from hugo-theme-diary.

AmazingRise avatar AmazingRise commented on June 8, 2024

Closed. The author of goldmark didn't approve this feature.

from hugo-theme-diary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.