From 6e842bb00fb8a196e05f3ab1e949792af662b490 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Mon, 10 Mar 2025 11:35:47 +0100 Subject: [PATCH] Remove a line that is clearing the hash fragment in the window URL for no reason. Wherever this line is there or not, adding a # fragment is anyway breaking the ability of Yasgui to use query params (e.g. ?query), so removing the hash does not do anything apart from introducing unwanted side effects and removing freedom from developers using Yasgui. Also improved a bit the readme docs to run tests --- README.md | 30 ++++++++++++++++++++++++------ packages/yasgui/src/linkUtils.ts | 1 - 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 173cb417..423fbf25 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,35 @@ yarn add @zazuko/yasgui ## Local development -#### Installing dependencies +### Install dependencies -Run `npm install`. +```sh +npm install +``` -#### Running Yasgui locally +### Run Yasgui locally -To develop locally, run `npm run dev` +To develop locally, run: -#### Compiling Yasgui +```sh +npm run dev +``` -Run `npm run build`. It'll store the transpiled js/css files in the `build` directory. +### Compiling Yasgui + +It'll store the transpiled js/css files in the `build` directory. Run: + +```sh +npm run build +``` + +### Run tests + +You'll first need to compile it, then run: + +```sh +npm test +``` ## License diff --git a/packages/yasgui/src/linkUtils.ts b/packages/yasgui/src/linkUtils.ts index fcbab0e3..ab1d89fe 100644 --- a/packages/yasgui/src/linkUtils.ts +++ b/packages/yasgui/src/linkUtils.ts @@ -15,7 +15,6 @@ var getUrlParams = function (_url?: string) { //firefox does some decoding if we're using window.location.hash (e.g. the + sign in contentType settings) //Don't want this. So simply get the hash string ourselves url.query(url.anchor()); - if (urlFromWindow) window.location.hash = ""; //clear hash } return url; };