File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
(tbd)
4
4
5
- -
5
+ - Added ` ToXml ` and ` ToMarkup ` extensions for the formatting
6
6
7
7
# 0.12.1
8
8
Original file line number Diff line number Diff line change
1
+ namespace AngleSharp . Xml
2
+ {
3
+ using System ;
4
+
5
+ /// <summary>
6
+ /// Extensions for the markup formattable elements.
7
+ /// </summary>
8
+ public static class MarkupFormatterExtensions
9
+ {
10
+ /// <summary>
11
+ /// Returns the serialization of the object model guided by the
12
+ /// XML markup formatter.
13
+ /// </summary>
14
+ /// <param name="markup">The markup to serialize.</param>
15
+ /// <returns>The source code snippet.</returns>
16
+ public static String ToXml ( this IMarkupFormattable markup ) =>
17
+ markup . ToHtml ( XmlMarkupFormatter . Instance ) ;
18
+
19
+ /// <summary>
20
+ /// Returns the serialization of the object model guided by the
21
+ /// auto selected (XML, XHTML, HTML) markup formatter.
22
+ /// </summary>
23
+ /// <param name="markup">The markup to serialize.</param>
24
+ /// <returns>The source code snippet.</returns>
25
+ public static String ToMarkup ( this IMarkupFormattable markup ) =>
26
+ markup . ToHtml ( new AutoSelectedMarkupFormatter ( ) ) ;
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments