Skip to content

Commit b2ea113

Browse files
author
p01
committed
Fix DFL-3724, Text resources are trimmed up to the first coma in the Detail view
1 parent ab1d82c commit b2ea113

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/resource-manager/resource_templates.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,16 @@ window.templates.resource_detail || (window.templates.resource_detail = new func
346346

347347
this.text = function(resource)
348348
{
349-
var data = resource.data.content.stringData;
350-
var pos = data.indexOf(",");
351-
var is_base64 = data.lastIndexOf(";base64", pos) != -1;
349+
var text = resource.data.content.stringData;
352350

353-
return ["pre", is_base64 ? atob(data.slice(pos + 1)) : data.slice(pos + 1)];
351+
if (text.startswith("data:"))
352+
{
353+
var pos = text.indexOf(",");
354+
var is_base64 = text.lastIndexOf(";base64", pos) != -1;
355+
text = is_base64 ? atob(text.slice(pos + 1)) : text.slice(pos + 1);
356+
}
357+
358+
return ["pre", text];
354359
};
355360

356361
this.markup = function(resource)

0 commit comments

Comments
 (0)