-
-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XHTMLish output #56
Comments
Well, the DOM serialization is specified (hence fixed). However, we could now do two things. Either you call a method that takes options, which will do the serialization (well, this is somewhat flexible, but not as much as I would like), or there will be a visitor like pattern, where the user gets to choose what serialization he wants to take - and how he wants to deal with it. |
I now provide another My guess is that this approach is flexible enough to fit all needs associated with node serialization. Let me know if you think something is still missing. |
Thank you, looks great. There are cases when it's needed to format InnerHtml of an element. Would you consider adding |
Yes! |
It'd be easier to inherit from |
That all is on purpose. Please FCoI. The class itself has no data members and is only a functional construct. It should be treated as such. The class is also only visible, that you can actually use its methods. |
Got it. However, I have trouble with writing a formatter implementation for following requirements. Line breaks should be inserted before and after each block element (looking just at its name: For example: <div>123</div>456<div>789</div><div>abc</div><ul><li>aa</li><li>bb</li></ul> should be converted to <div>123</div>
456
<div>789</div>
<div>abc</div>
<ul>
<li>aa</li>
<li>bb</li>
</ul> TinyMCE formats HTML this way. The demo on the main page shows formatted HTML if you click _Tools -> Source code_. Just in case, here is their implementation. |
I thought I implemented it, but suddenly it turned out that |
Yap, I call |
I need to convert a document to such a format that it should be both HTML and XML in the same time. That is, the markup like
<select/>
is not allowed, should be<select></select>
instead, but the markup like<img src="..." />
is required. Would be nice if AngularSharp could provide some control over the process of DOM serialization.Html Agility Pack has something like this. At least, it can output XHTML.
The text was updated successfully, but these errors were encountered: