Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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()));
            }
        }
Exemplo n.º 6
0
        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()));
            }
        }
Exemplo n.º 7
0
 public static Node ParseFile(System.IO.FileStream fileStream, CMarkOptions options = default(CMarkOptions))
 {
     return ParseFile(fileStream.SafeFileHandle.DangerousGetHandle(), options);
 }
Exemplo n.º 8
0
 public static Node ParseFile(IntPtr fileHandle, CMarkOptions options = default(CMarkOptions))
 {
     return Node.Create(cmark_parse_file(fileHandle, options.ToOptions()));
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
        public static Node ParseDocument(byte[] buffer, CMarkOptions options = default(CMarkOptions))
        {
            Ensure.ArgumentNotNull(buffer, nameof(buffer));

            return ParseDocument(buffer, 0, buffer.Length, options);
        }
Exemplo n.º 11
0
 public static Node ParseDocument(IntPtr buffer, int length, CMarkOptions options = default(CMarkOptions))
 {
     return Node.Create(cmark_parse_document(buffer, length, options.ToOptions()));
 }
Exemplo n.º 12
0
 public static Node ParseFile(System.IO.FileStream fileStream, CMarkOptions options = default(CMarkOptions))
 {
     return ParseFile(fileStream.SafeFileHandle.DangerousGetHandle(), options);
 }
Exemplo n.º 13
0
 public static Node ParseFile(IntPtr fileHandle, CMarkOptions options = default(CMarkOptions))
 {
     return Node.Create(cmark_parse_file(fileHandle, options.ToOptions()));
 }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
        public static Node ParseDocument(byte[] buffer, CMarkOptions options = default(CMarkOptions))
        {
            Ensure.ArgumentNotNull(buffer, nameof(buffer));

            return ParseDocument(buffer, 0, buffer.Length, options);
        }
Exemplo n.º 16
0
 public static Node ParseDocument(IntPtr buffer, int length, CMarkOptions options = default(CMarkOptions))
 {
     return Node.Create(cmark_parse_document(buffer, length, options.ToOptions()));
 }