Skip to content

Repo Topic Containing Backslash Leads to Javascript Error #31328

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

Closed
kdumontnu opened this issue Jun 11, 2024 · 4 comments · Fixed by #33851
Closed

Repo Topic Containing Backslash Leads to Javascript Error #31328

kdumontnu opened this issue Jun 11, 2024 · 4 comments · Fixed by #33851
Labels

Comments

@kdumontnu
Copy link
Contributor

Description

If you create a repo topic with a backslash you receive the following javascript error:

Error: Syntax error, unrecognized expression: [data-value="test\"]
    at Ha.error (jquery.js:1487:8)
    at Tu (jquery.js:2153:8)
    at Cc (jquery.js:2578:12)

It's unclear if this is getting through some escape code or if this indicates a larger issue.

To recreate, go to a repository -> manage topics -> "test" -> Enter

Gitea Version

gitea.com

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Screenshot 2024-06-11 at 5 41 41 PM

Git Version

No response

Operating System

No response

How are you running Gitea?

gitea.com

Database

None

@silverwind
Copy link
Member

silverwind commented Jun 11, 2024

Seems like a bug in Fomantic-UI based on that stack trace. Likely missing CSS.escape. Given that we are not updating Fomantic-UI anymore, we probably need a alternative JS solution for this tag entry, or move the remaining Fomantic JS into first-party vendor code and fix it there.

image

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 12, 2024

Actually / and \ is not supported:

image


Update: hmm, I see, the trailing \ causes the problem 😁 I guess it's not easy to fix and maybe no need to fix

@silverwind
Copy link
Member

I guess we could move the remaining fomantic source files to editable first-party files. Been meaning to to that for at least the CSS files, but also possible for the JS.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 11, 2025

-> Fix various Fomantic UI problems #33851

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

Successfully merging a pull request may close this issue.

3 participants