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.

IElement.Insert() strips ‌

See original GitHub issue

Bug Report

Description

the zero-width-non-joiner is removed by AngleSharp, when using IElement.Insert(). (using AngleSharp 0.16.0)

Steps to Reproduce

heading.Insert(AdjacentPosition.AfterBegin, $"<a name=\"{entry.Id}\">&zwnj;</a>");

Expected behavior: I expect the html to be inserted as set. (ie. <a name="234">&zwnj;</a>)

Actual behavior: In the string returned from ie. .InnerHtml the &zwnj; is removed (ie. <a name="234"></a>). If I replace it with &nbsp; that is not removed.

Environment details: Windows 10, .Net5 (core)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
utillitycommented, Oct 18, 2021

awesome! Thanks for the clarification!

1reaction
FlorianRapplcommented, Oct 13, 2021

This is not how it works. Entities are always replaced with their character representations. There are only some exclusions, see the formatter (https://github.com/AngleSharp/AngleSharp/blob/devel/src/AngleSharp/Html/HtmlMarkupFormatter.cs#L162).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove &zwnj; characters - javascript
The jQuery .text() method does a nice job of sanitizing the input, it returns text, only, and strips the rest away.
Read more >
Add space-format characters to str.strip - Python discussion
strip() ( str.strip(None) ) removes the leading and trailing characters whose Unicode property White_Space is yes , but leaves invisible space ...
Read more >
luatex - How to insert a specific unicode character (such as ...
What I'm stuck with is trying to figure out how to insert the ZWNJ character (a "node" in luatex speak? of what type?)...
Read more >
Word delimiter token filter | Elasticsearch Guide [8.9]
Split tokens at non-alphanumeric characters. The filter uses these characters as delimiters. For example: Super-Duper → Super , Duper; Remove leading or ...
Read more >
CSS Entities
Complete CSS Entity Reference ... If you use CSS to display any of these characters in HTML, you can use the CSS entity...
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