Skip to content

Conversation

@Strokkur424
Copy link
Member

@Strokkur424 Strokkur424 commented Sep 18, 2025

closes #1296.

@Strokkur424 Strokkur424 marked this pull request as ready for review September 20, 2025 09:28
@Strokkur424 Strokkur424 changed the base branch from main/4 to unstable/4 September 23, 2025 11:09
@Strokkur424
Copy link
Member Author

I've rebased the PR to the unstable/4 branch so that I can do some work for the upcoming head tag with the changes introduced here already.

@kezz kezz added this to the 4.25.0 milestone Sep 23, 2025
@Strokkur424 Strokkur424 changed the base branch from unstable/4 to main/4 September 23, 2025 12:41
@Strokkur424 Strokkur424 changed the base branch from main/4 to unstable/4 September 23, 2025 12:42
@Strokkur424 Strokkur424 changed the base branch from unstable/4 to main/4 September 23, 2025 13:18
@Strokkur424
Copy link
Member Author

Rebased to main/4 after the unstable/4 merge

@kezz kezz modified the milestones: 4.25.0, 4.26.0 Oct 3, 2025
@zml2008
Copy link
Member

zml2008 commented Oct 13, 2025

So a thought on this, why are we creating two different colours of MM tags? I feel like the design would be cleaner if we only had one type of tag, which accepted both named and sequential arguments, same as say with a CLI. For consistency's sake I think it's fair to require all the named args to be at the beginning or end of the tag, but either way there's a bunch of api noise and opportunity for breakages here due to adding named args in as a separate parallel concept.

I'm seeing something like:

<gradient phase=0.4 speed=2 red:green:blue>hi strokkur</gradient>

or:

<gradient:red:green:blue phase=0.4 speed=2>hi strokkur</gradient>

What do you think? Users would just pop named args from the ArgumentQueue same as other items

@Strokkur424 Strokkur424 changed the base branch from main/4 to main/5 November 5, 2025 17:45
KNOWN ISSUES/NOTES:
- *Yes*, I did indeed completely rewrite TokenParser.parseSecondPass. A few notes related to that:
  - This was needed because the previous system did not really play well with with state switches between named args and sequential ones and was honestly really hard to work with in general. My hopes are that with this rewrite it will be much more maintainable and readable.
  - Tags, which look like this <name > currently parse the same as <name>. I am awaiting a response regarding whether we want to make this the new expected behavior or if I need to do some special case handling for it.
  - Urls in values currently do not work. That's a quick fix though.
@Strokkur424
Copy link
Member Author

Alright, I've done everything I've wanted to do for this PR now. Arguments have been implemented, as per @zml2008's suggestion, in a combined way. They new syntax looks like this:

<tagname
    someflag
    somename='a quoted value with spaces'
    anotherflag :queued arguments behind:here>Hey abby</tagname>

This means named arguments are simply placed between the tag name and the first colon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Named MiniMessage arguments

4 participants