Skip to content

Encode newline with break tag#135

Open
briancordanyoung wants to merge 2 commits intoJohnSundell:masterfrom
briancordanyoung:encode-newline-as-break
Open

Encode newline with break tag#135
briancordanyoung wants to merge 2 commits intoJohnSundell:masterfrom
briancordanyoung:encode-newline-as-break

Conversation

@briancordanyoung
Copy link

@briancordanyoung briancordanyoung commented Nov 27, 2023

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? ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant