diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index c47786e..2952057 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1376,14 +1376,29 @@ function update_metadata(meta) { } +function html_escape(input) { + return $('
').text(input).html() +} + function update_wsjt_panel(msg) { var $b = $('#openwebrx-panel-wsjt-message tbody'); var t = new Date(msg['timestamp']); var pad = function(i) { return ('' + i).padStart(2, "0"); } var linkedmsg = msg['msg']; - var matches = linkedmsg.match(/(.*\s[A-Z0-9]+\s)([A-R]{2}[0-9]{2})$/); - if (matches && matches[2] != 'RR73') { - linkedmsg = matches[1] + '' + matches[2] + ''; + if (msg['mode'] == 'FT8') { + var matches = linkedmsg.match(/(.*\s[A-Z0-9]+\s)([A-R]{2}[0-9]{2})$/); + if (matches && matches[2] != 'RR73') { + linkedmsg = html_escape(matches[1]) + '' + matches[2] + ''; + } else { + linkedmsg = html_escape(linkedmsg); + } + } else if (msg['mode'] == 'WSPR') { + var matches = linkedmsg.match(/([A-Z0-9]*\s)([A-R]{2}[0-9]{2})(\s[0-9]+)/); + if (matches) { + linkedmsg = html_escape(matches[1]) + '' + matches[2] + '' + html_escape(matches[3]); + } else { + linkedmsg = html_escape(linkedmsg); + } } $b.append($( '