Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

<PRE> tag for console output #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fdub
Copy link

@fdub fdub commented Sep 29, 2017

Console output should be printed out as is, so a div tag is not a good choice. Using a pre tag, the console outputs are unchanged.

@Pomax
Copy link
Member

Pomax commented Sep 29, 2017

That will not change the interpretation of the strings printed: <...> will still be interpreted as markup, not literal text. What should happen is that data gets "safified" with respect to html entities, so something along the lines of:

var forceHTMLEntities = (function(){
  var converter = document.createElement('div');
  return function(data) {
    converter.textContent = data;
    return converter.innerHTML;
  };
}());

Which is then called using escapedInput = forceHTMLEntities(input) etc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy