Skip to content

Add CSS class support for task lists to resolve bullet point display issue#82

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-43
Closed

Add CSS class support for task lists to resolve bullet point display issue#82
Copilot wants to merge 1 commit intomainfrom
copilot/fix-43

Conversation

Copy link
Contributor

Copilot AI commented Jun 8, 2025

This PR addresses the issue where task lists display both bullets and checkboxes, creating visual clutter. The solution adds automatic CSS class assignment to task lists, allowing developers to style them appropriately.

Problem

When creating task lists with checkboxes, browsers display both bullets and checkboxes:

- [x] Completed task
- [ ] Pending task

Previously rendered as:

<ul>
  <li><input type="checkbox" disabled checked />Completed task</li>
  <li><input type="checkbox" disabled />Pending task</li>
</ul>

This results in both bullets (•) and checkboxes (☑) being displayed, which is visually redundant.

Solution

The implementation automatically detects task lists and adds a configurable CSS class:

<ul class="task-list">
  <li><input type="checkbox" disabled checked />Completed task</li>
  <li><input type="checkbox" disabled />Pending task</li>
</ul>

Developers can now hide bullets with CSS:

.task-list {
  list-style: none;
}

Key Features

  • Automatic detection: Task lists are identified by the presence of [x] or [ ] syntax
  • Configurable CSS class: Default is task-list, customizable via lists.tasks.class
  • Selective application: Only task lists get the class; regular lists remain unchanged
  • Mixed list support: Lists containing both task items and regular items get the class
  • Works with both <ul> and <ol>: Ordered task lists are also supported

Configuration

$parser = new ParsedownExtended();

// Default usage (class="task-list")
echo $parser->text("- [x] Done\n- [ ] Todo");

// Custom class
$parser->config()->set('lists.tasks.class', 'my-custom-task-list');

// Disable feature
$parser->config()->set('lists.tasks.enabled', false);

Breaking Changes

⚠️ Configuration structure updated:

  • Old: lists.tasks (boolean)
  • New: lists.tasks.enabled (boolean) and lists.tasks.class (string)

This change enables the new CSS class functionality while maintaining the ability to enable/disable task lists.

Fixes #43.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.github.com
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/KnWkis /usr/bin/composer install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@BenjaminHoegh BenjaminHoegh marked this pull request as ready for review June 8, 2025 13:43
Copilot AI review requested due to automatic review settings June 8, 2025 13:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@BenjaminHoegh BenjaminHoegh deleted the copilot/fix-43 branch June 8, 2025 13:44
Copilot AI restored the copilot/fix-43 branch June 8, 2025 13:47
Copilot AI changed the title [WIP] Bullets appear in tasks lists Add CSS class support for task lists to resolve bullet point display issue Jun 8, 2025
Copilot AI requested a review from BenjaminHoegh June 8, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bullets appear in tasks lists

3 participants