aboutsummaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/docs.moon2
-rw-r--r--extra/layout.moon5
2 files changed, 5 insertions, 2 deletions
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) ->