on master help sign in
Markdown, docs: escape {% strings
20a2135Matilde Park
components/Markdown.js+9
@@ -147,6 +147,13 @@ const callout = {
147 },
147 },
148};
148};
149
149
150+const customFence = {
151+ render: "CustomFence",
152+ attributes: {},
153+};
154+
155+const CustomFence = ({ children }) => <pre>{children}</pre>;
156+
150export default function Markdown({ post }) {
157export default function Markdown({ post }) {
151 const ast = Markdoc.parse(post.content);
158 const ast = Markdoc.parse(post.content);
152 const finalAst = footnoteParse(ast);
159 const finalAst = footnoteParse(ast);
@@ -162,6 +169,7 @@ export default function Markdown({ post }) {
162 tab,
169 tab,
163 button,
170 button,
164 callout,
171 callout,
172+ customFence,
165 },
173 },
166 });
174 });
167 return Markdoc.renderers.react(content, React, {
175 return Markdoc.renderers.react(content, React, {
@@ -171,6 +179,7 @@ export default function Markdown({ post }) {
171 Tab,
179 Tab,
172 Button,
180 Button,
173 Callout,
181 Callout,
182+ CustomFence,
174 },
183 },
175 });
184 });
176}
185}
content/docs/arvo/clay/examples.md+4−3
@@ -517,10 +517,11 @@ First, using the `send-task-take-gift.hoon` thread, let's try creating a new `de
517
517
518Now if we scry for our `desk`s we'll see `%foo` is there:
518Now if we scry for our `desk`s we'll see `%foo` is there:
519
519
520−```
520+{% customFence %}
521+
521> .^((set desk) %cd /===)
522> .^((set desk) %cd /===)
522−{%bitcoin %base %landscape %webterm %garden %foo}
523+> &#x7B;&#x25;bitcoin %base %landscape %webterm %garden %foo}
523−```
524+> {% /customFence %}
524
525
525Next, we'll create a merge conflict and try a couple of things. Mount `%foo` with `|mount /=foo=`, then add a `foo.txt` to both `desk`s but with different text in each and `|commit` them.
526Next, we'll create a merge conflict and try a couple of things. Mount `%foo` with `|mount /=foo=`, then add a `foo.txt` to both `desk`s but with different text in each and `|commit` them.
526
527
content/docs/arvo/clay/scry.md+5−4
@@ -49,10 +49,11 @@ A scry with a `care` of `%d` will return a `(set desk)` of the `desk`s that exis
49
49
50Example:
50Example:
51
51
52−```
52+{% customFence %}
53+
53−> .^((set desk) %cd /===)
54+\> .^((set desk) %cd /===)
54−{%bitcoin %base %landscape %webterm %garden}
55+&#x7B;&#x25;bitcoin %base %landscape %webterm %garden}
55−```
56+{% /customFence %}
56
57
57## %e - Static mark core.
58## %e - Static mark core.
58
59
content/docs/hoon/guides/strings.md+5−5
@@ -175,11 +175,11 @@ This is something to be wary of. For example, if you wanted to form a `(set @tas
175However, this will actually form a set of the union `?(%foo %bar %baz)` due to
175However, this will actually form a set of the union `?(%foo %bar %baz)` due to
176the specificity of type inference:
176the specificity of type inference:
177
177
178−```
178+{% customFence %}
179−> ? (silt (limo ~[%foo %bar %baz]))
179+\> ? (silt (limo ~[%foo %bar %baz]))
180− ?(%~ [?(n=%bar n=%baz n=%foo) l=nlr(?(%bar %baz %foo)) r=nlr(?(%bar %baz %foo))])
180+?(%~ [?(n=%bar n=%baz n=%foo) l=nlr(?(%bar %baz %foo)) r=nlr(?(%bar %baz %foo))])
181−[n=%baz l={%bar} r={%foo}]
181+[n=%baz l&#x7B;&#x25;bar} r=&#x7B;&#x25;foo}]
182−```
182+{% /customFence %}
183
183
184One further note about the type-as-itself form: Ocassionally you may wish to
184One further note about the type-as-itself form: Ocassionally you may wish to
185form a union of strings which contain characters disallowed in `term`s. To get
185form a union of strings which contain characters disallowed in `term`s. To get
content/docs/hoon/reference/stdlib/2i.md+6−5
@@ -825,12 +825,13 @@ A set.
825
825
826#### Examples
826#### Examples
827
827
828−```
828+{% customFence %}
829−> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
830
829
830+\> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
831+
831−> ~(key by a)
832+\> ~(key by a)
832−{%b %d %a %c}
833+{&#x7B;&#x25;b %d %a %c}
833−```
834+{% /customFence %}
834
835
835---
836---
836
837
content/docs/hoon/reference/stdlib/4g.md+8−8
@@ -202,14 +202,14 @@ Either a `tape` or a crash.
202
202
203#### Source
203#### Source
204
204
205−```hoon
205+{% customFence %}
206−++ scan |* [los=tape sab=rule]
206+++ scan |\* [los=tape sab=rule]
207− =+ vex=((full sab) [[1 1] los])
207+=+ vex=((full sab) [[1 1] los])
208− ?~ q.vex
208+?~ q.vex
209− ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
209+~_ (show [%m '&#x7B;&#x25;d %d}'] p.p.vex q.p.vex ~)
210− ~_(leaf+"syntax error" !!)
210+~_(leaf+"syntax error" !!)
211− p.u.q.vex
211+p.u.q.vex
212−```
212+{% /customFence %}
213
213
214#### Examples
214#### Examples
215
215