question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sanitizing parsers

See original GitHub issue

Is your feature request related to a problem? Please describe. Several people have seen unexpected behaviour due to control codes that have been embedded in the data that they set in a widget - e.g. putting \r characters in the data. This causes all sorts of odd layout problems displaying the widget (as the control codes change location on the screen to something unexpected).

Describe the solution you’d like Now that we have parsers, how about creating one that simply replaces all control codes with a readable version - e.g. “^M” for \r, etc. Simply add this parser to the widget when you construct it and you never see the issue again!

Added bonus is that this will still maintain the control codes in the data stream should you need to recreate them afterwards.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
peterbrittaincommented, Oct 4, 2019

That branch is still under development and so please, by all means, have a look and play, but don’t rely on the API staying the same by the time it is merged into master.

0reactions
peterbrittaincommented, Oct 7, 2019

Implemented by #229

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safe DOM manipulation with the Sanitizer API - web.dev
To sanitize correctly, it is necessary to parse the input string as HTML, omit tags and attributes that are considered harmful, and keep...
Read more >
Sanitizing HTML 'parser' - gists · GitHub
Sanitizing HTML 'parser'. GitHub Gist: instantly share code, notes, and snippets.
Read more >
HTML Sanitizer API - MDN Web Docs
Parsing and sanitizing strings. The result of parsing a string of HTML depends on the context/the element into which it is inserted.
Read more >
Sanitize untrusted HTML (to prevent XSS) - Jsoup
The jsoup safelist sanitizer works by parsing the input HTML (in a safe, sand-boxed environment), and then iterating through the parse tree and...
Read more >
Introduction to Text Analysis: Cleaning/Parsing
Computers work well when there is structure to a data source or, at least, some regular patterns that it can identify. Most cleaning...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found