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

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new b8c6774ee65 optimize version regex (#442)
b8c6774ee65 is described below

commit b8c6774ee6521437888d59baacfa66bb5d3673f2
Author: Li Li <[email protected]>
AuthorDate: Wed Mar 1 11:11:56 2023 +0800

    optimize version regex (#442)
    
    Signed-off-by: Li Li <[email protected]>
---
 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)

Reply via email to