public static unsafe Node ParseDocument(byte[] buffer, int index, int count, CMarkOptions options = default(CMarkOptions)) { Ensure.InRange(buffer, nameof(buffer), index, nameof(index), count, nameof(count)); fixed (byte* ptr = buffer) { return ParseDocument((IntPtr)ptr + index, count, options); } }
public static Node ParseDocument(string text, Encoding encoding = null, CMarkOptions options = default(CMarkOptions)) { if (encoding == null) { encoding = Encoding.Default; } return ParseDocument(encoding.GetBytes(text), options); }
public static unsafe string ToHtml(string text, Encoding encoding = null, CMarkOptions options = default(CMarkOptions)) { if (encoding == null) { encoding = Encoding.Default; } var bytes = encoding.GetBytes(text); fixed (byte* ptr = bytes) { return new string(cmark_markdown_to_html(ptr, bytes.Length, options.ToOptions())); } }
public static Node ParseFile(System.IO.FileStream fileStream, CMarkOptions options = default(CMarkOptions)) { return ParseFile(fileStream.SafeFileHandle.DangerousGetHandle(), options); }
public static Node ParseFile(IntPtr fileHandle, CMarkOptions options = default(CMarkOptions)) { return Node.Create(cmark_parse_file(fileHandle, options.ToOptions())); }
public static Node ParseDocument(ArraySegment<byte> byteSegment, CMarkOptions options = default(CMarkOptions)) { Ensure.ArgumentNotDefault(byteSegment, nameof(byteSegment)); return ParseDocument(byteSegment.Array, byteSegment.Offset, byteSegment.Count, options); }
public static Node ParseDocument(byte[] buffer, CMarkOptions options = default(CMarkOptions)) { Ensure.ArgumentNotNull(buffer, nameof(buffer)); return ParseDocument(buffer, 0, buffer.Length, options); }
public static Node ParseDocument(IntPtr buffer, int length, CMarkOptions options = default(CMarkOptions)) { return Node.Create(cmark_parse_document(buffer, length, options.ToOptions())); }