Skip to content

Update reference regex to not break on beta versions #808

Closed
@davepagurek

Description

@davepagurek

Most appropriate sections of the p5.js website?

Reference

What is your operating system?

Mac OS

Web browser and version

Firefox

Actual Behavior

In the reference builder, we add a v to the start of the latest release if it seems to all be numeric:

if (/^\d+\.\d+\.\d+$/.exec(latestRelease)) {
latestRelease = 'v' + latestRelease;
}

This regex breaks for beta releases, e.g. 2.0.0-beta.5. We're about to release 2.0 so we won't have beta releases for a while, but we may want this working for the future when we do beta 3.0 releases.

Expected Behavior

The regex should match strings like 2.0.0-beta.5 too.

Steps to reproduce

Manually edit this

export const p5Version = "v2.0.0-beta.8" as const;
to not start with a v

Would you like to work on the issue?

Feel free to take this on for me!

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

Status

Completed

Relationships

None yet

Development

No branches or pull requests

Issue actions