You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2023/03/01 03:02:02 UTC

[pulsar-site] 01/01: optimize version regex

This is an automated email from the ASF dual-hosted git repository.

urfree pushed a commit to branch optimize-version-regex
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit c9d4f48637e9698d3d262663fc25bc3e0f89f8c1
Author: Li Li <ur...@apache.org>
AuthorDate: Wed Mar 1 11:01:50 2023 +0800

    optimize version regex
    
    Signed-off-by: Li Li <ur...@apache.org>
---
 src/utils/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils/index.js b/src/utils/index.js
index e9a0eb156d3..20861c6ddb4 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -56,7 +56,7 @@ export function setVersion(version) {
 export function getVersion() {
   try {
     if (/version=(\d+\.?\x?)+/.test(location.href)) {
-      return location.href.match(/version=((\d+\.?\x?)+)/)[1];
+      return location.href.match(/version=([0-9.x]+)/)[1];
     }
   } catch (error) {
     console.error(error)