Skip to content

Commit b764748

Browse files
authored
docs: fix rendering for | in code blocks in table (bytecodealliance#626)
The `|` was not rendering correctly inside code blocks within tables when processed by `mdbook`. rust-lang/mdBook#637 Idealy, this should be addressed by the upstream. The root cause of this problem in `pulldown-cmark` has recently been fixed. pulldown-cmark/pulldown-cmark#356 However, `mdbook` seems to expose the `pulldown-cmark` types as a public API, and is currently facing difficulties updating its dependencies. rust-lang/mdBook#2386 Therefore, the upstream fix may not available in any time soon. As a workaround for the time being, use <code> tag instead of code blocks in tables with `|`.
1 parent 8309be7 commit b764748

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/wit-type-representations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ Jco represents options as an optional value or undefined, so some examples:
137137

138138
| Type | Representation (TS) | Example |
139139
|-----------------------|-----------------------------------------|---------------------------------------|
140-
| `option<u32>` | `number | undefined` | `option<u32>` -> `number | undefined` |
141-
| `option<option<u32>>` | `{ tag: "some" | "none", val: number }` | `option<u32>` -> `number | undefined` |
140+
| `option<u32>` | <code>number \| undefined</code> | `option<u32>` -> <code>number \| undefined</code> |
141+
| `option<option<u32>>` | <code>{ tag: "some" \| "none", val: number }</code> | `option<u32>` -> <code>number \| undefined</code> |
142142

143143
> [!WARNING]
144144
> "single level" `option`s are easy to reason about, but the doubly nested case (`option<option<_>>`) is more complex.

0 commit comments

Comments
 (0)