Splash icon indicating copy to clipboard operation
Splash copied to clipboard

Encode newline with break tag

Open briancordanyoung opened this issue 1 year ago • 0 comments

Sequential comments are currently output enclosed within a single span tag with newlines between each comment line. This results in a comments like this:

        // comment line 1
        // comment line 2
        func expressTheCommentAbove()

...being displayed in a browser as:

        // comment line 1 // comment line 2
        func expressTheCommentAbove()

This PR adds newlines to the escapingHTMLEntities() method so that these newlines are output using the <br> tag. Given this change, it may even make sense to rename this method to encodingHTMLEntities().

⚠️ All tests are passing. However, it is important to consider if there are any other cases where this behavior is not what you want. Is there any other case where a single <span> covers multiple lines and this new behavior would result in an unexpected output? ⚠️

briancordanyoung avatar Nov 27 '23 05:11 briancordanyoung