opcodesio/log-viewer

Newlines to <br> lost in context ouput

GavG opened this issue · 2 comments

GavG commented

The prepareContextForOutput method translates newlines to
tage for display.

https://github.com/opcodesio/log-viewer/blob/main/resources/js/components/BaseLogTable.vue#L193

However, the output is then passed through the highlightSearchResult method:

https://github.com/opcodesio/log-viewer/blob/main/resources/js/helpers.js#L16

Which calls escapeHtml, escaping any added <br> tags.

I suspect an additional,:

.replace(/&lt;br\/&gt;/g, '<br/>');

Call might solve the issue, I can't forsee this opening up an XSS vector.

GavG commented

Addressing in the above PR: #285

Thanks a lot for the report and the fix @GavG 💪 tagged a new release, v3.1.5