diff --git a/lib/commonmark/node/source-span.vala b/lib/commonmark/node/source-span.vala index 560b9db47d316eb43c7600f3b401c124c2110532..8cebe4c8fe9c497917531cfb4f1c6e8c8a333a49 100644 --- a/lib/commonmark/node/source-span.vala +++ b/lib/commonmark/node/source-span.vala @@ -16,7 +16,7 @@ namespace Commonmark.Node { * * If a block has multiple lines, it will have a source span for each line. * - * Note that the column index and length are measured in Java characters + * Note that the column index and length are measured in unichar characters * (UTF-16 code units). If you're outputting them to be consumed by another * programming language, e.g. one that uses UTF-8 strings, you will need to * translate them, otherwise characters such as emojis will result in diff --git a/lib/commonmark/parser/include-source-spans.vala b/lib/commonmark/parser/include-source-spans.vala index 7a4a1a99dcf8b6e205e0ea811e177fe8e125ed57..36313c63dc3643c48b7490339388c3de2aa07ecd 100644 --- a/lib/commonmark/parser/include-source-spans.vala +++ b/lib/commonmark/parser/include-source-spans.vala @@ -1,8 +1,8 @@ namespace Commonmark.Parser { /** - * Whether to include Commonmark.Node.SourceSpan or not while parsing, see - * Parser.Builder#include_source_spans(IncludeSourceSpans). + * Whether to include {@link Node.SourceSpan} or not while parsing, see + * {@link Parser.Builder.include_source_spans}. */ public enum IncludeSourceSpans { diff --git a/lib/commonmark/parser/parser.vala b/lib/commonmark/parser/parser.vala index 9a1d46e191e978c8ea1b1efa81aad715b6c1144e..7d2ac6db6bd7d0c7fcf43e5027feaa37599be054 100644 --- a/lib/commonmark/parser/parser.vala +++ b/lib/commonmark/parser/parser.vala @@ -66,10 +66,15 @@ namespace Commonmark.Parser { * responsible for closing the reader. * * {{{ - * var file = GLib.File.new_for_path("file.md"); - * var reader = new GLib.DataInputStream(file.read()); - * var document = parser.parse_reader(reader); - * ... + * try { + * var file = GLib.File.new_for_path("file.md"); + * var reader = new GLib.DataInputStream(file.read()); + * var parser = Commonmark.Parser.Parser.builder().build(); + * var document = parser.parse_reader(reader); + * ... + * } catch (GLib.Error error) { + * ... + * } * }}} * * Note that if you have a file with a byte order mark (BOM), you need @@ -94,8 +99,8 @@ namespace Commonmark.Parser { return post_process(document); } - private Commonmark.Internal.DocumentParser create_document_parser() { - return new Commonmark.Internal.DocumentParser( + private Internal.DocumentParser create_document_parser() { + return new Internal.DocumentParser( block_parser_factories, inline_parser_factory, delimiter_processors, include_source_spans); } @@ -292,7 +297,7 @@ namespace Commonmark.Parser { public InlineParser create(InlineParserContext inline_parser_context) { - return new Commonmark.Internal.InlineParserImpl( + return new Internal.InlineParserImpl( inline_parser_context); } } diff --git a/lib/commonmark/renderer/html/html-renderer.vala b/lib/commonmark/renderer/html/html-renderer.vala index e33f7d516a591ceec6c19e5e9cb6b74ad4bc6e61..6c440c6f3fe61b8be9dd1b105e7fc5c4fe48fffe 100644 --- a/lib/commonmark/renderer/html/html-renderer.vala +++ b/lib/commonmark/renderer/html/html-renderer.vala @@ -3,7 +3,7 @@ namespace Commonmark.Renderer.Html { /** * Renders a tree of nodes to HTML. * - * Start with the {@link HtmlRenderer.builder} method to configure the + * Start with the {@link Commonmark.Renderer.Html.HtmlRenderer.builder} method to configure the * renderer. Example: * * {{{ @@ -16,7 +16,7 @@ namespace Commonmark.Renderer.Html { public class HtmlRenderer : GLib.Object, Renderer { private string softbreak; - private bool escape_html; + private bool _escape_html; private bool sanitize_urls; private UrlSanitizer url_sanitizer; private bool _percent_encode_urls; @@ -25,7 +25,7 @@ namespace Commonmark.Renderer.Html { private HtmlRenderer(Builder builder) { this.softbreak = builder._softbreak; - this.escape_html = builder.escape_html; + this._escape_html = builder._escape_html; this.sanitize_urls = builder._sanitize_urls; this._percent_encode_urls = builder._percent_encode_urls; this.url_sanitizer = builder._url_sanitizer; @@ -82,7 +82,7 @@ namespace Commonmark.Renderer.Html { public class Builder : GLib.Object { public string _softbreak = "\n"; - public bool escape_html = false; + public bool _escape_html = false; public bool _sanitize_urls = false; public UrlSanitizer _url_sanitizer = new DefaultUrlSanitizer(); public bool _percent_encode_urls = false; @@ -125,12 +125,11 @@ namespace Commonmark.Renderer.Html { * text between an opening tag and a closing tag. So markup in the * text will be parsed as normal and is not affected by this option. * - * @param escape_html true for escaping, false for preserving raw - * HTML + * @param _escape_html true for escaping, false for preserving raw HTML * @return ''this'' */ - public Builder escapeHtml(bool escape_html) { - this.escape_html = escape_html; + public Builder escape_html(bool _escape_html) { + this._escape_html = _escape_html; return this; } @@ -150,7 +149,7 @@ namespace Commonmark.Renderer.Html { /** * {@link UrlSanitizer} used to filter URL's if {@link - * HtmlRenderer.sanitize_urls} is true. + * Commonmark.Renderer.Html.HtmlRenderer.sanitize_urls} is true. * * @param _url_sanitizer Filterer used to filter {@link Node.Image} * src and {@link Node.Link}. @@ -168,14 +167,10 @@ namespace Commonmark.Renderer.Html { * * If enabled, the following is done: * - *