#1291  PullRequest / Commit UI: HTML renders escaped special characters instead of showing the escaped character
Released
jbauer opened 1 year ago

Source code

var test = "this is a text\n";

renders as

var test = "this is a text
";

in pull request file changes UI as well as in single commit UI. OneDev needs to escape source code before using it in HTML context.

Source code rendered in Code -> Files -> seems fine.

Robin Shen commented 1 year ago

Strangely this works at my side:

2023-04-01_08-57-40.png

Please reproduce with a sample repo, and attach the repo here.

Robin Shen commented 1 year ago

@jbauer any details on reproducing this?

jbauer commented 1 year ago

@robin Maybe only java files are affected? You used a JS file but I see the issue in pull requests containing java files with literal strings in them.

jbauer commented 1 year ago

@robin It is within in the collapsed, unmodified code. Go to https://code.onedev.io/jbauer/~pulls/2/changes and open the skipped 4 lines at the top.

Robin Shen commented 1 year ago

@jbauer Thanks for the info. Will get it fixed soon.

OneDev changed state to 'Closed' 1 year ago
Previous Value Current Value
Open
Closed
OneDev commented 1 year ago

State changed as code fixing the issue is committed (9dfb37ed)

OneDev changed state to 'Released' 1 year ago
Previous Value Current Value
Closed
Released
OneDev commented 1 year ago

State changed as build #3563 is successful

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Affected Versions
8.0.10
Issue Votes (0)
Watchers (4)
Reference
onedev/server#1291
Please wait...
Page is in error, reload to recover