Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest html file in a Chinese path, there ate some error #797

Open
Mutiantian opened this issue Jan 30, 2024 · 1 comment
Open

pytest html file in a Chinese path, there ate some error #797

Mutiantian opened this issue Jan 30, 2024 · 1 comment

Comments

@Mutiantian
Copy link

Mutiantian commented Jan 30, 2024

pytest html file in a Chinese path, there ate some error

in pure english path:
企业微信截图_17066134131866

path has some Chinese
企业微信截图_17066130942020

@Mutiantian
Copy link
Author

const hideCategory = (categoryToHide) => {
    const url = new URL(window.location.href)
    const visibleParams = new URLSearchParams(url.search).get('visible')
    const currentVisible = visibleParams ? visibleParams.split(',') : [...possibleFilters]
    const settings = [...new Set(currentVisible)].filter((f) => f !== categoryToHide).join(',')

    url.searchParams.set('visible', settings)
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }

}
const showCategory = (categoryToShow) => {
    if (typeof window === 'undefined') {
        return
    }
    const url = new URL(window.location.href)
    const currentVisible = new URLSearchParams(url.search).get('visible')?.split(',').filter(Boolean) ||
        [...possibleFilters]
    const settings = [...new Set([categoryToShow, ...currentVisible])]
    const noFilter = possibleFilters.length === settings.length || !settings.length

    noFilter ? url.searchParams.delete('visible') : url.searchParams.set('visible', settings.join(','))
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }
}
const setSort = (type) => {
    const url = new URL(window.location.href)
    url.searchParams.set('sort', type)
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }
}

here should add some try catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant