PullRequest / Commit UI: HTML renders escaped special characters instead of showing the escaped character (OD-1291)
jbauer opened 3 years 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 3 years 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 3 years ago

    @jbauer any details on reproducing this?

  • jbauer commented 3 years 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 3 years 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 3 years ago

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

  • OneDev changed state to 'Closed' 3 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 3 years ago

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

  • OneDev changed state to 'Released' 3 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 3 years ago

    State changed as build #3563 is successful

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
8.0.10
Issue Votes (0)
Watchers (4)
Reference
OD-1291
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover