From fb463f545fc7ac0a03e37f6136863f727d9d8b10 Mon Sep 17 00:00:00 2001 From: Andrey Makarov Date: Sun, 4 Sep 2022 21:52:21 +0300 Subject: [PATCH] Implement Pandoc Markdown concise link extension (#20304) * Implement Pandoc Markdown concise link extension This implements https://github.com/nim-lang/Nim/issues/20127. Besides reference to headings we also support doing references to Nim symbols inside Nim modules. Markdown: ``` Some heading ------------ Ref. [Some heading]. ``` Nim: ``` proc someFunction*() ... ... ## Ref. [someFunction] ``` This is substitution for RST syntax like `` `target`_ ``. All 3 syntax variants of extension from Pandoc Markdown are supported: `[target]`, `[target][]`, `[description][target]`. This PR also fixes clashes in existing files, particularly conflicts with RST footnote feature, which does not work with this PR (but there is a plan to adopt a popular [Markdown footnote extension](https://pandoc.org/MANUAL.html#footnotes) to make footnotes work). Also the PR fixes a bug that Markdown links did not work when `[...]` section had a line break. The implementation is straightforward since link resolution did not change w.r.t. RST implementation, it's almost only about new syntax addition. The only essential difference is a possibility to add a custom link description: form `[description][target]` which does not have an RST equivalent. * fix nim 1.0 gotcha --- src/db_postgres.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db_postgres.nim b/src/db_postgres.nim index 82403ab009..e629b79454 100644 --- a/src/db_postgres.nim +++ b/src/db_postgres.nim @@ -271,7 +271,7 @@ iterator instantRows*(db: DbConn, query: SqlQuery, args: varargs[string, `$`]): InstantRow {.tags: [ReadDbEffect].} = ## same as fastRows but returns a handle that can be used to get column text - ## on demand using []. Returned handle is valid only within iterator body. + ## on demand using `[]`. Returned handle is valid only within iterator body. setupSingeRowQuery(db, query, args) fetchinstantRows(db) @@ -279,7 +279,7 @@ iterator instantRows*(db: DbConn, stmtName: SqlPrepared, args: varargs[string, `$`]): InstantRow {.tags: [ReadDbEffect].} = ## same as fastRows but returns a handle that can be used to get column text - ## on demand using []. Returned handle is valid only within iterator body. + ## on demand using `[]`. Returned handle is valid only within iterator body. setupSingeRowQuery(db, stmtName, args) fetchinstantRows(db)