Skip to content

Add support for start attribute on ordered lists#116

Merged
LittleLittleCloud merged 3 commits intomainfrom
copilot/add-ordered-list-start-attribute
Nov 15, 2025
Merged

Add support for start attribute on ordered lists#116
LittleLittleCloud merged 3 commits intomainfrom
copilot/add-ordered-list-start-attribute

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

Implements HTML5 start attribute for <ol> elements to allow custom starting numbers.

Changes

  • HtmlListElementTranslator: Extract and parse start attribute, use for list numbering (defaults to 1)
  • Tests: Add coverage for valid start values and invalid/missing attribute fallback
  • Gallery: Add example demonstrating start="50"

Usage

<ol start="50">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

Renders as 50. Coffee, 51. Tea, 52. Milk.

Original prompt

This section details on the original issue you should resolve

<issue_title>ordered list - support start attribute</issue_title>
<issue_description>https://www.w3schools.com/tags/att_ol_start.asp

<ol start="50">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
````</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 15, 2025 05:41
Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
Co-authored-by: LittleLittleCloud <16876986+LittleLittleCloud@users.noreply.github.com>
@LittleLittleCloud LittleLittleCloud marked this pull request as ready for review November 15, 2025 05:46
Copilot AI review requested due to automatic review settings November 15, 2025 05:46
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.

Pull Request Overview

This PR adds support for the HTML start attribute on ordered lists (<ol>) to allow custom starting numbers, addressing issue #115.

  • Implemented start attribute parsing in HtmlListElementTranslator with fallback to default value of 1 for invalid inputs
  • Added comprehensive unit tests covering both valid and invalid start attribute values
  • Enhanced the Gallery showcase to demonstrate ordered lists starting at a custom number (50)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/RazorConsole.Core/Vdom/Translators/HtmlListElementTranslator.cs Added logic to read and apply the start attribute for ordered lists, with safe parsing and default fallback
src/RazorConsole.Tests/Vdom/VdomSpectreTranslatorTests.cs Added two test cases: one verifying custom start numbers work correctly, and one ensuring invalid values default gracefully to 1
src/RazorConsole.Gallery/Components/HtmlListGallery.razor Added demonstration of ordered list with start="50" attribute in both Preview and example code sections

@LittleLittleCloud LittleLittleCloud enabled auto-merge (squash) November 15, 2025 05:50
Copilot AI changed the title [WIP] Add support for start attribute in ordered list Add support for start attribute on ordered lists Nov 15, 2025
@LittleLittleCloud LittleLittleCloud merged commit 97d556b into main Nov 15, 2025
16 checks passed
@LittleLittleCloud LittleLittleCloud deleted the copilot/add-ordered-list-start-attribute branch November 15, 2025 05:51
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.

ordered list - support start attribute

3 participants