Commit graph

42 commits

Author SHA1 Message Date
Michael Macias
b1ceb3e80e rendering: Avoid prepending URL prefix to links that start with a scheme (#817)
Links that start with a scheme (e.g., `tel:18008675309`) inadvertently
had a URL prefix prepended. Previously, only `mailto:` was handled, but
given the sheer number of [registered URI schemes][uri-schemes], a loose
pattern matcher is used to detect schemes instead.

External links, as identified by the renderer, are now limited to `http`
and `https` schemes.

Fixes #747 and fixes #816.

[uri-schemes]: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
2020-02-02 17:44:38 -08:00
Marcus Klaas de Vries
4fd5d3f348 Bump pulldown_cmark to version 0.6.0 (#797)
* Bump pulldown_cmark to version 0.6.0

* Rename headers to headings
2019-09-06 23:36:30 +02:00
Vincent Prouillet
0e4e0c35b3 Remove all draft specific code 2019-07-19 11:10:28 +02:00
Vincent Prouillet
99abbb87a1
Set up CI with Azure Pipelines (#750)
* Set up CI with Azure Pipelines

[skip ci]

* Remove other CI + remove newline in anchor link tpl

* Some more Windows specific changes
2019-07-19 10:35:31 +02:00
Vincent Prouillet
af00a2e8f1 Add tests for custom url scheme 2019-07-15 20:18:24 +02:00
Vincent Prouillet
cb962f7a64 Add aliases to sections 2019-06-02 20:21:06 +02:00
Vincent Prouillet
ec61a57841 Use @/ for internal links rather than ./
Close #686
2019-05-27 14:35:18 +02:00
Marcus Klaas de Vries
0d964204c3 Check command global (#683)
* Add check subcommand

* Add some brief documentation for the check subcommand

* Start working on parallel link checks

* Check all external links in Site

* Return *all* dead links in site
2019-05-27 14:05:07 +02:00
Chris Morgan
1a9ab968fe Allow manual specification of header IDs (#685)
Justification for this feature is added in the docs.

Precedent for the precise syntax: Hugo.

Hugo puts this syntax behind a preference named headerIds, and automatic
header ID generation behind a preference named autoHeaderIds, with both
enabled by default. I have not implemented a switch to disable this.

My suggestion for a workaround for the improbable case of desiring a
literal “{#…}” at the end of a header is to replace `}` with `}`.

The algorithm I have used is not identical to [that
which Hugo uses][0], because Hugo’s looks to work at the source level,
whereas here we work at the pulldown-cmark event level, which is
generally more sane, but potentially limiting for extremely esoteric
IDs.

Practical differences in implementation from Hugo (based purely on
reading [blackfriday’s implementation][0], not actually trying it):

- I believe Hugo would treat `# Foo {#*bar*}` as a heading with text
  “Foo” and ID `*bar*`, since it is working at the source level; whereas
  this code turns it into a heading with HTML `Foo {#<em>bar</em>}`, as
  it works at the pulldown-cmark event level and doesn’t go out of its
  way to make that work (I’m not familiar with pulldown-cmark, but I get
  the impression that you could make it work Hugo’s way on this point).
  The difference should be negligible: only *very* esoteric hashes would
  include magic Markdown characters.

- Hugo will automatically generate an ID for `{#}`, whereas what I’ve
  coded here will yield a blank ID instead (which feels more correct to
  me—`None` versus `Some("")`, and all that).

In practice the results should be identical.

Fixes #433.

[0]: a477dd1646/block.go (L218-L234)
2019-05-20 13:08:49 -07:00
Vincent Prouillet
3eaf13d49b Update pulldown_cmark 2019-03-15 21:29:51 +01:00
Vincent Prouillet
d1154d236f Comment out failing test while its getting fixed in Tera 2019-01-26 11:46:54 +01:00
Vincent Prouillet
464e384760
Merge pull request #581 from peng1999/event-refined
Footnote is now supported in headers
2019-01-22 17:24:33 +01:00
Vincent Prouillet
5caf24f06c Remove error-chain
Closes #576
2019-01-17 14:31:47 +01:00
Vincent Prouillet
69fb399726 Add failing shortcode body split test 2019-01-17 14:31:47 +01:00
Peng Guanwen
80786a2fbb Revert accidentally change 2019-01-12 17:25:01 +08:00
Peng Guanwen
c027cd97d6 Footnote is now supported in headers
This fixes #569 .

`markdown_to_html` is heavily refactored, header-related things is
handled in a second pass.
2019-01-12 16:55:52 +08:00
toidiu
09f691fa47 add id to continue reading p tag (#577)
* add id to continue reading p tag
2019-01-07 19:20:19 +01:00
Peng Guanwen
972aab1ac4 Add emphasis, strong and code support in header 2019-01-05 23:50:30 +08:00
Vincent Prouillet
e2c3bb2ce2 Fix shortcodes <-> markdown indentation 2018-11-16 18:19:38 +01:00
Vincent Prouillet
7af314c61e Update deps + fmt 2018-11-14 17:34:21 +01:00
Vincent Prouillet
b7ce4e59fb rustfmt 2018-10-31 08:18:57 +01:00
Vincent Prouillet
f84ae7c93b Rename all occurrences of gutenberg to zola in code 2018-10-18 22:50:06 +02:00
Michael Plotke
4db629a060 prevent html tags from appearing in the toc 2018-10-18 08:58:50 -04:00
Vincent Prouillet
ee3f4dc511 Update to syntect 3 2018-10-09 14:33:43 +02:00
Vincent Prouillet
f100d956c6 Fix incorrect default for highlight_code of Config 2018-09-20 20:07:20 +02:00
Vincent Prouillet
b4158921dd Fix email links being checked by link checker
Closes #403
2018-09-10 12:40:31 +02:00
Thomas Hurst
68690a2cf1 Add a test for summary handling in Markdown rendering. 2018-08-24 22:46:28 +01:00
Thomas Hurst
c53c403790 Update rendering tests 2018-08-24 22:37:55 +01:00
Vincent Prouillet
e0291cec65 Add Swift, MiniZinc syntax and update the rest
Also fix tests

Close #367, #372
2018-08-15 15:42:43 +02:00
Vincent Prouillet
3e48ff24b5 Add an external link checker
Close #115
2018-07-16 21:15:50 +02:00
Vincent Prouillet
3eb571fdbf Trim left every line of a shortcode to avoid the accidental markdown codeblock 2018-06-25 18:04:00 +02:00
Vincent Prouillet
d69ada09d2 Make permalinks out of co-located images 2018-06-25 18:00:05 +02:00
Vincent Prouillet
ef543b3d2b Make co-located asset link permalinks 2018-06-25 18:00:05 +02:00
Vincent Prouillet
d39edd8ecb Allow links in headers 2018-06-25 18:00:05 +02:00
Vincent Prouillet
85e13483eb Use the new shortcode parser 2018-06-25 18:00:05 +02:00
Vincent Prouillet
d67211bfd6 Fix many shortcode parsing issues
Closes #228
Closes #229
2018-03-28 19:41:04 +02:00
Vincent Prouillet
77634ebe83 Update syntect 2018-01-02 17:46:51 +01:00
Reilly Tucker Siemens
e662f73438 Hack fix and new tests for body-shortcodes 2017-10-29 18:02:48 -07:00
Vincent Prouillet
9d0f84051d Add test for unterminated shortcode# 2017-10-23 15:54:32 +02:00
Vincent Prouillet
7d7efdd6ea Handle markdown parser potentially splitting shortcodes 2017-10-23 14:18:05 +02:00
Vincent Prouillet
c2b190513e Refactor markdown header rendering 2017-09-27 23:09:13 +09:00
Vincent Prouillet
ce704097a4 Add benches for rendering crate 2017-07-04 21:27:32 +09:00