X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2FrecordViewer%2FrecordDetails.jsx;h=9b35d1ba377c4bc5d07e3676b4cbc82649f81604;hb=73b4ff94fca62a769a0bc13971a05cd18e177b33;hp=0a3e35eb8cbda0786425ffec84d4eac5520f652a;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git
diff --git a/skyquake/plugins/launchpad/src/recordViewer/recordDetails.jsx b/skyquake/plugins/launchpad/src/recordViewer/recordDetails.jsx
index 0a3e35eb8..9b35d1ba3 100644
--- a/skyquake/plugins/launchpad/src/recordViewer/recordDetails.jsx
+++ b/skyquake/plugins/launchpad/src/recordViewer/recordDetails.jsx
@@ -27,7 +27,17 @@ export default class RecordDetails extends React.Component{
}
render(){
let html;
- let text = JSON.stringify(this.props.data, undefined, 2);
+ // Prism can't handle escaped \n and other characters
+ let text = JSON.stringify(this.props.data, undefined, 2)
+ .replace(/\r\n/g, '\n')
+ .replace(/\\\\n/g, "\n")
+ .replace(/\\\\'/g, "\'")
+ .replace(/\\\\"/g, '\"')
+ .replace(/\\\\&/g, "\&")
+ .replace(/\\\\r/g, "\r")
+ .replace(/\\\\t/g, "\t")
+ .replace(/\\\\b/g, "\b")
+ .replace(/\\\\f/g, "\f");
// html = this.props.isLoading ?
{JSON.stringify(this.props.data, undefined, 2)}; html = this.props.isLoading ?