@@ -20,7 +20,7 @@ public extension CMNode {
2020 /// `CMDocumentError.renderError` if there is an error rendering the HTML.
2121 /// - Returns:
2222 /// The HTML as a string.
23- func renderHtml( _ options: CMDocumentOption , extensions: CMExtensionOption ) throws -> String {
23+ func renderHtml( _ options: CMDocumentOption , extensions: CMExtensionOption ) async throws -> String {
2424 var htmlExtensions : UnsafeMutablePointer < cmark_llist > ?
2525
2626 if extensions. contains ( . tagfilters) , let tagfilter = cmark_find_syntax_extension ( " tagfilter " ) {
@@ -35,7 +35,7 @@ public extension CMNode {
3535 free ( buffer)
3636 }
3737
38- guard let html = String ( validatingUTF8 : buffer) else {
38+ guard let html = String ( validatingCString : buffer) else {
3939 throw CMDocumentError . renderError
4040 }
4141
@@ -50,7 +50,7 @@ public extension CMNode {
5050 /// `CMDocumentError.renderError` if there is an error rendering the XML.
5151 /// - Returns:
5252 /// The XML as a string.
53- func renderXml( _ options: CMDocumentOption ) throws -> String {
53+ func renderXml( _ options: CMDocumentOption ) async throws -> String {
5454 guard let buffer = cmark_render_xml ( cmarkNode, options. rawValue) else {
5555 throw CMDocumentError . renderError
5656 }
@@ -59,7 +59,7 @@ public extension CMNode {
5959 free ( buffer)
6060 }
6161
62- guard let xml = String ( validatingUTF8 : buffer) else {
62+ guard let xml = String ( validatingCString : buffer) else {
6363 throw CMDocumentError . renderError
6464 }
6565
@@ -75,7 +75,7 @@ public extension CMNode {
7575 /// `CMDocumentError.renderError` if there is an error rendering the man page.
7676 /// - Returns:
7777 /// The man page as a string.
78- func renderMan( _ options: CMDocumentOption , width: Int32 ) throws -> String {
78+ func renderMan( _ options: CMDocumentOption , width: Int32 ) async throws -> String {
7979 guard let buffer = cmark_render_man ( cmarkNode, options. rawValue, width) else {
8080 throw CMDocumentError . renderError
8181 }
@@ -84,7 +84,7 @@ public extension CMNode {
8484 free ( buffer)
8585 }
8686
87- guard let man = String ( validatingUTF8 : buffer) else {
87+ guard let man = String ( validatingCString : buffer) else {
8888 throw CMDocumentError . renderError
8989 }
9090
@@ -100,7 +100,7 @@ public extension CMNode {
100100 /// `CMDocumentError.renderError` if there is an error rendering the common mark.
101101 /// - Returns:
102102 /// The common mark as a string.
103- func renderCommonMark( _ options: CMDocumentOption , width: Int32 ) throws -> String {
103+ func renderCommonMark( _ options: CMDocumentOption , width: Int32 ) async throws -> String {
104104 guard let buffer = cmark_render_commonmark ( cmarkNode, options. rawValue, width) else {
105105 throw CMDocumentError . renderError
106106 }
@@ -109,7 +109,7 @@ public extension CMNode {
109109 free ( buffer)
110110 }
111111
112- guard let commonMark = String ( validatingUTF8 : buffer) else {
112+ guard let commonMark = String ( validatingCString : buffer) else {
113113 throw CMDocumentError . renderError
114114 }
115115
@@ -125,7 +125,7 @@ public extension CMNode {
125125 /// `CMDocumentError.renderError` if there is an error rendering the Latex.
126126 /// - Returns:
127127 /// The Latex as a string.
128- func renderLatex( _ options: CMDocumentOption , width: Int32 ) throws -> String {
128+ func renderLatex( _ options: CMDocumentOption , width: Int32 ) async throws -> String {
129129 guard let buffer = cmark_render_latex ( cmarkNode, options. rawValue, width) else {
130130 throw CMDocumentError . renderError
131131 }
@@ -134,7 +134,7 @@ public extension CMNode {
134134 free ( buffer)
135135 }
136136
137- guard let latex = String ( validatingUTF8 : buffer) else {
137+ guard let latex = String ( validatingCString : buffer) else {
138138 throw CMDocumentError . renderError
139139 }
140140
@@ -150,7 +150,7 @@ public extension CMNode {
150150 /// `CMDocumentError.renderError` if there is an error rendering the plain text.
151151 /// - Returns:
152152 /// The plain text as a string.
153- func renderPlainText( _ options: CMDocumentOption , width: Int32 ) throws -> String {
153+ func renderPlainText( _ options: CMDocumentOption , width: Int32 ) async throws -> String {
154154 guard let buffer = cmark_render_plaintext ( cmarkNode, options. rawValue, width) else {
155155 throw CMDocumentError . renderError
156156 }
@@ -159,7 +159,7 @@ public extension CMNode {
159159 free ( buffer)
160160 }
161161
162- guard let text = String ( validatingUTF8 : buffer) else {
162+ guard let text = String ( validatingCString : buffer) else {
163163 throw CMDocumentError . renderError
164164 }
165165
0 commit comments