From d69a818887eb571622e8bc98f06b3eda3491dbbd Mon Sep 17 00:00:00 2001 From: s-ol Date: Tue, 17 Mar 2020 20:19:13 +0100 Subject: doc/guide: small formatting & typos --- extra/docs.moon | 2 +- extra/layout.moon | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'extra') diff --git a/extra/docs.moon b/extra/docs.moon index 4bc4892..d1553df 100644 --- a/extra/docs.moon +++ b/extra/docs.moon @@ -75,7 +75,7 @@ spit OUT, switch command contents = slurp file require 'discount' - layout compile autoref contents, 'githubtags', 'fencedcode' + layout compile (autoref contents), 'githubtags', 'fencedcode' when 'ldoc' BASE = '$(base)' diff --git a/extra/layout.moon b/extra/layout.moon index 2741a70..a3d67c8 100644 --- a/extra/layout.moon +++ b/extra/layout.moon @@ -40,6 +40,9 @@ link = (ref) -> mod, sym = ref\match '^(.+)/(.*)$' abs "reference/#{mod or 'index'}.html##{sym or ref}" +escape = (str) -> + (str\gsub '([*`])', '\\%1') + -- link to a reference r = (text, ref) -> import a, code from require 'extra.dom' @@ -48,7 +51,7 @@ r = (text, ref) -> a text, :href else text = text\gsub '/$', '' - a (code text), :href + a (code escape text), :href -- substitute markdown-style reference links autoref = (str) -> -- cgit v1.2.3